pub struct DiscovererBuilder<'a, Key> { /* private fields */ }
Expand description

Builder for Discoverers.

See Discoverer for usage examples.

Implementations§

source§

impl<'a, Key> DiscovererBuilder<'a, Key>

source

pub fn new(client: &'a Handle) -> Self

Creates a new DiscovererBuilder.

source

pub async fn build(self) -> Result<Discoverer<Key>, Error>

Builds the discoverer with the configured set of objects.

source

pub async fn build_current_only(self) -> Result<Discoverer<Key>, Error>

Builds the discoverer and configures it to consider only current objects and services.

Unlike build, the discoverer will consider only those objects and services that exist already on the bus.

source

pub fn object( self, key: Key, object: Option<ObjectUuid>, services: impl IntoIterator<Item = ServiceUuid> ) -> Self

Add an object to the discoverer.

The key is an arbitrary value that can later be queried again on DiscovererEvents. It can be used to distinguish events when more than one object has been added.

When specifying an ObjectUuid, the discoverer will match only on that UUID. Otherwise, the discoverer will emit events for every object that matches the set of services.

source

pub fn any( self, key: Key, services: impl IntoIterator<Item = ServiceUuid> ) -> Self

Registers interest in any object implementing a set of services.

This is a shorthand for calling object(key, None, services).

source

pub fn specific( self, key: Key, object: impl Into<ObjectUuid>, services: impl IntoIterator<Item = ServiceUuid> ) -> Self

Registers interest in a specific object implementing a set of services.

This is a shorthand for calling object(key, Some(object), services).

Trait Implementations§

source§

impl<'a, Key: Debug> Debug for DiscovererBuilder<'a, Key>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a, Key> Freeze for DiscovererBuilder<'a, Key>

§

impl<'a, Key> !RefUnwindSafe for DiscovererBuilder<'a, Key>

§

impl<'a, Key> Send for DiscovererBuilder<'a, Key>
where Key: Send,

§

impl<'a, Key> Sync for DiscovererBuilder<'a, Key>
where Key: Sync,

§

impl<'a, Key> Unpin for DiscovererBuilder<'a, Key>
where Key: Unpin,

§

impl<'a, Key> !UnwindSafe for DiscovererBuilder<'a, Key>

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<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, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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.