pub struct ChannelKey(pub u64);Expand description
A flavor-chosen stable identity for a channel.
§Why the builder asks for this
The guide’s builder derives a channel’s scope from its parent but never says where its identity comes from. Something has to: the diff needs to recognize the same channel across two renders, and an identity that drifts burns a wire id every turn.
Deriving it from the name would be the obvious guess and is exactly the trap the guide names (15, “never put changing content in an identity”): a channel whose name carries a clock would be destroyed and recreated ten times a second. So the flavor states the identity explicitly and keeps the name a field. Two channels rendered in one turn with the same key is a build error, not a merge.
Tuple Fields§
§0: u64Implementations§
Source§impl ChannelKey
impl ChannelKey
Sourcepub const ROOT: ChannelKey
pub const ROOT: ChannelKey
The key crate::build::ShardBuilder::root gives the shard’s root.
Named because a flavor addressing its whole tree has to spell it, and a bare zero in that position reads like a mistake.
Trait Implementations§
Source§impl Clone for ChannelKey
impl Clone for ChannelKey
Source§fn clone(&self) -> ChannelKey
fn clone(&self) -> ChannelKey
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more