trouble-host

Crates

git

Versions

default

Flavors

Skip to main content

Advertiser

Struct Advertiser 

Source
pub struct Advertiser<'d, C, P: PacketPool> { /* private fields */ }
Expand description

Handle to an active advertiser which can accept connections.

Implementations§

Source§

impl<'d, C: Controller, P: PacketPool> Advertiser<'d, C, P>

Source

pub async fn accept(self) -> Result<Connection<'d, P>, Error>

Accept the next peripheral connection for this advertiser.

Returns Error::Timeout if advertiser stopped.

For a legacy advertiser, a returned connection is what stops the advertising: the runner disables legacy advertising in the controller before the state is idle again. This also covers a connection that an earlier (replaced) advertising made: the controller stops that advertising itself and reports the connection to this advertiser, and its own advertising would otherwise stay enabled. Disabling legacy advertising that is already disabled has no effect (Bluetooth Core v6.2, Vol 4, Part E, §7.8.9), so this is safe when the controller already stopped the advertising. If the future is dropped before it completes, the advertising is disabled as when an Advertiser is dropped.

For an extended advertiser, the controller stops the advertising set that made the connection itself, and no disable command is sent. Other advertising sets are not affected.

Trait Implementations§

Source§

impl<C, P: PacketPool> Drop for Advertiser<'_, C, P>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

§

impl<'d, C, P> !RefUnwindSafe for Advertiser<'d, C, P>

§

impl<'d, C, P> !Send for Advertiser<'d, C, P>

§

impl<'d, C, P> !Sync for Advertiser<'d, C, P>

§

impl<'d, C, P> !UnwindSafe for Advertiser<'d, C, P>

§

impl<'d, C, P> Freeze for Advertiser<'d, C, P>

§

impl<'d, C, P> Unpin for Advertiser<'d, C, P>

§

impl<'d, C, P> UnsafeUnpin for Advertiser<'d, C, P>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.