pub struct Registry { /* private fields */ }
Implementations§
Source§impl Registry
impl Registry
pub fn new(proxy: RegistryProxy) -> Self
Sourcepub async fn device_info(&self, token_id: TokenId) -> Option<DeviceInfo>
pub async fn device_info(&self, token_id: TokenId) -> Option<DeviceInfo>
Returns information about the device with the given token_id
.
Returns None if there is no device with the given ID.
Sourcepub async fn device_infos(&self) -> BTreeMap<TokenId, DeviceInfo>
pub async fn device_infos(&self) -> BTreeMap<TokenId, DeviceInfo>
Returns information about all devices in the registry.
Sourcepub async fn observe(&self, token_id: TokenId) -> Result<RegistryDevice, Error>
pub async fn observe(&self, token_id: TokenId) -> Result<RegistryDevice, Error>
Returns a RegistryDevice that observes the device with the given token_id
.
Returns an error if there is no device with the given token ID.
Sourcepub async fn subscribe(&self) -> DeviceEventReceiver
pub async fn subscribe(&self) -> DeviceEventReceiver
Returns a channel of device events.
Auto Trait Implementations§
impl Freeze for Registry
impl !RefUnwindSafe for Registry
impl Send for Registry
impl Sync for Registry
impl Unpin for Registry
impl !UnwindSafe for Registry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
Source§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more