pub struct ChannelKinds { /* private fields */ }Expand description
Registry mapping Channel types to compact wire net-IDs and their ChannelSettings.
Implementations§
Source§impl ChannelKinds
impl ChannelKinds
Sourcepub fn add_channel<C: Channel>(&mut self, settings: ChannelSettings)
pub fn add_channel<C: Channel>(&mut self, settings: ChannelSettings)
Registers channel type C with the given settings, assigning it the next sequential net-ID.
Sourcepub fn channels(&self) -> Vec<(ChannelKind, ChannelSettings)>
pub fn channels(&self) -> Vec<(ChannelKind, ChannelSettings)>
Returns all registered (ChannelKind, ChannelSettings) pairs.
Sourcepub fn channel(&self, kind: &ChannelKind) -> ChannelSettings
pub fn channel(&self, kind: &ChannelKind) -> ChannelSettings
Returns the ChannelSettings for the given kind. Panics if the kind was not registered.
Sourcepub fn all_names(&self) -> Vec<String>
pub fn all_names(&self) -> Vec<String>
Returns a sorted list of all registered channel protocol names.
Sourcepub fn channel_name(&self, kind: &ChannelKind) -> Option<&str>
pub fn channel_name(&self, kind: &ChannelKind) -> Option<&str>
Returns the protocol name for kind, or None if not registered.
Sourcepub fn channel_names(&self) -> Vec<(ChannelKind, String)>
pub fn channel_names(&self) -> Vec<(ChannelKind, String)>
Returns all (ChannelKind, protocol_name) pairs registered in this registry.
Trait Implementations§
Source§impl Clone for ChannelKinds
impl Clone for ChannelKinds
Source§fn clone(&self) -> ChannelKinds
fn clone(&self) -> ChannelKinds
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ChannelKinds
impl RefUnwindSafe for ChannelKinds
impl Send for ChannelKinds
impl Sync for ChannelKinds
impl Unpin for ChannelKinds
impl UnsafeUnpin for ChannelKinds
impl UnwindSafe for ChannelKinds
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