Struct aldrin::DiscovererBuilder
source · pub struct DiscovererBuilder<'a, Key> { /* private fields */ }
Expand description
Builder for Discoverer
s.
See Discoverer
for usage examples.
Implementations§
source§impl<'a, Key> DiscovererBuilder<'a, Key>
impl<'a, Key> DiscovererBuilder<'a, Key>
sourcepub async fn build(self) -> Result<Discoverer<Key>, Error>
pub async fn build(self) -> Result<Discoverer<Key>, Error>
Builds the discoverer with the configured set of objects.
sourcepub async fn build_current_only(self) -> Result<Discoverer<Key>, Error>
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.
sourcepub fn object(
self,
key: Key,
object: Option<ObjectUuid>,
services: impl IntoIterator<Item = ServiceUuid>,
) -> Self
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
DiscovererEvent
s. 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.
sourcepub fn specific(
self,
key: Key,
object: impl Into<ObjectUuid>,
services: impl IntoIterator<Item = ServiceUuid>,
) -> Self
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)
.
sourcepub fn any(
self,
key: Key,
services: impl IntoIterator<Item = ServiceUuid>,
) -> Self
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)
.