pub struct Registry { /* private fields */ }Expand description
The relay’s device registry: device-id -> a sender feeding that device’s single writer thread (commands + pong replies).
Implementations§
Source§impl Registry
impl Registry
pub fn new() -> Self
Sourcepub fn route_event(&self, device: &str, event: &SemanticEvent) -> usize
pub fn route_event(&self, device: &str, event: &SemanticEvent) -> usize
Only explicitly capable registrations receive non-injecting events.
Sourcepub fn is_registered(&self, device: &str) -> bool
pub fn is_registered(&self, device: &str) -> bool
Whether device currently has a live registration.
Sourcepub fn device_ids(&self) -> Vec<String>
pub fn device_ids(&self) -> Vec<String>
The device ids currently registered, sorted (bd-bc8b5c). Used to answer a
sender’s list query so operators can see which cross-device endpoints
are connected to the hub.
Sourcepub fn device_count(&self) -> usize
pub fn device_count(&self) -> usize
Number of currently-registered devices.
Sourcepub fn route(&self, device: &str, cmd: &InjectionCommand) -> usize
pub fn route(&self, device: &str, cmd: &InjectionCommand) -> usize
Route a command to one device id, or to all when device == "all".
Returns the number of devices the command was delivered to (queued).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Registry
impl RefUnwindSafe for Registry
impl Send for Registry
impl Sync for Registry
impl Unpin for Registry
impl UnsafeUnpin 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