pub struct ChannelName(/* private fields */);Expand description
A validated channel name.
Names are hierarchical with / separators. Valid characters are
alphanumeric, -, _, ., and /. Names must not be empty,
start or end with /, or contain //.
Implementations§
Source§impl ChannelName
impl ChannelName
Sourcepub fn new(name: &str) -> Result<ChannelName, ChannelError>
pub fn new(name: &str) -> Result<ChannelName, ChannelError>
Create a new channel name, validating the format.
Sourcepub fn hash(&self) -> u32
pub fn hash(&self) -> u32
Compute the canonical ChannelHash (32-bit) for the name.
This is the substrate-wide key used for ACL, storage, and config decisions. Collision-resistant at realistic deployment scale (~65 K channels before birthday-collision threshold).
Sourcepub fn wire_hash(&self) -> u16
pub fn wire_hash(&self) -> u16
Compute the wire u16 channel hash for the Net header fast-path.
The hint stamped on every outgoing packet — fast to compare but only
65,536 buckets, so it has routine collisions at mesh scale.
Control-plane and storage authorization key on
ChannelName::hash (canonical u32), not on this wire hint.
Sourcepub fn is_prefix_of(&self, other: &ChannelName) -> bool
pub fn is_prefix_of(&self, other: &ChannelName) -> bool
Check if this name is a prefix of another (for wildcard subscriptions).
Trait Implementations§
Source§impl Clone for ChannelName
impl Clone for ChannelName
Source§fn clone(&self) -> ChannelName
fn clone(&self) -> ChannelName
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ChannelName
impl Debug for ChannelName
Source§impl Display for ChannelName
impl Display for ChannelName
Source§impl Hash for ChannelName
impl Hash for ChannelName
Source§impl PartialEq for ChannelName
impl PartialEq for ChannelName
Source§fn eq(&self, other: &ChannelName) -> bool
fn eq(&self, other: &ChannelName) -> bool
self and other values to be equal, and is used by ==.