pub struct ChannelRegistry { /* private fields */ }Expand description
The channels a session can hold a conversation in, and the keys to reach them.
Channel membership already lives in the MAC, which resolves an inbound frame to a key by authenticating it. This is the chat layer’s own view: it maps between the tag a conversation is keyed by and the key a send needs, in both directions.
Implementations§
Source§impl ChannelRegistry
impl ChannelRegistry
Sourcepub fn register(
&mut self,
tag: ChannelTag,
key: ChannelKey,
max_flood_hops: Option<u8>,
)
pub fn register( &mut self, tag: ChannelTag, key: ChannelKey, max_flood_hops: Option<u8>, )
Hold tag’s channel, reached with key. Registering a held channel
again replaces its key and ceiling.
pub fn remove(&mut self, tag: &ChannelTag)
pub fn key(&self, tag: &ChannelTag) -> Option<ChannelKey>
Sourcepub fn tag_for(&self, key: &ChannelKey) -> Option<ChannelTag>
pub fn tag_for(&self, key: &ChannelKey) -> Option<ChannelTag>
The tag of the held channel key reaches.
A received frame names its channel by the key that authenticated it, which is the truth about which channel it belongs to: distinct keys may share the two-byte identifier the frame carried.
Sourcepub fn max_flood_hops(&self, tag: &ChannelTag) -> Option<u8>
pub fn max_flood_hops(&self, tag: &ChannelTag) -> Option<u8>
The flood-hop ceiling registered for a channel, if the user set one.
None both for a channel left at the default and for one not
registered at all.
pub fn contains(&self, tag: &ChannelTag) -> bool
Trait Implementations§
Source§impl Clone for ChannelRegistry
impl Clone for ChannelRegistry
Source§fn clone(&self) -> ChannelRegistry
fn clone(&self) -> ChannelRegistry
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Default for ChannelRegistry
impl Default for ChannelRegistry
Source§fn default() -> ChannelRegistry
fn default() -> ChannelRegistry
Auto Trait Implementations§
impl Freeze for ChannelRegistry
impl RefUnwindSafe for ChannelRegistry
impl Send for ChannelRegistry
impl Sync for ChannelRegistry
impl Unpin for ChannelRegistry
impl UnwindSafe for ChannelRegistry
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)