Struct Channel
pub struct Channel { /* private fields */ }Expand description
A channel descriptor — holds the key, derived ID, and display name.
Not bound to any node. Create via Channel::named (key derived from name)
or Channel::private (key independent of name).
Implementations§
§impl Channel
impl Channel
pub fn named(name: &str) -> Result<Channel, ChannelNameError>
pub fn named(name: &str) -> Result<Channel, ChannelNameError>
Create a named channel whose key is derived from the name.
Uses the same derivation as the MAC layer’s add_named_channel: the
name is canonicalized (ASCII lowercase fold) before derivation, so
Public and public are the same channel. The display name keeps the
caller’s original casing. Fails if the name is non-ASCII or too long.
pub fn private(key: ChannelKey, name: &str) -> Channel
pub fn private(key: ChannelKey, name: &str) -> Channel
Create a private channel with an explicit key.
The name is for display only — it does not affect the key.
pub fn channel_id(&self) -> &ChannelId
pub fn channel_id(&self) -> &ChannelId
The derived 2-byte channel ID (used for routing/filtering).
pub fn key(&self) -> &ChannelKey
pub fn key(&self) -> &ChannelKey
The full symmetric channel key.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Channel
impl RefUnwindSafe for Channel
impl Send for Channel
impl Sync for Channel
impl Unpin for Channel
impl UnwindSafe for Channel
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
Mutably borrows from an owned value. Read more
§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)
🔬This is a nightly-only experimental API. (
clone_to_uninit)