pub struct LambLabel(/* private fields */);Expand description
A sheep’s own name for one of its lambs
Holds at most LambLabel::MAX_CHARS characters and no control
character, whether built with LambLabel::new or read off the wire.
Empty is a real value: it clears a label rather than setting one.
Implementations§
Source§impl LambLabel
impl LambLabel
Sourcepub const MAX_CHARS: usize = 64
pub const MAX_CHARS: usize = 64
The most characters a label may hold, counted as Unicode scalar values.
Sourcepub fn new(label: impl Into<String>) -> Result<LambLabel, LambLabelError>
pub fn new(label: impl Into<String>) -> Result<LambLabel, LambLabelError>
A label, checked against the channel’s grammar.
§Errors
LambLabelError::TooLongwhenlabelhas more thanSelf::MAX_CHARScharacters.LambLabelError::ControlCharacterwhenlabelholds one, a newline included.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for LambLabel
impl<'de> Deserialize<'de> for LambLabel
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<LambLabel, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<LambLabel, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for LambLabel
Source§impl Serialize for LambLabel
impl Serialize for LambLabel
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for LambLabel
Auto Trait Implementations§
impl Freeze for LambLabel
impl RefUnwindSafe for LambLabel
impl Send for LambLabel
impl Sync for LambLabel
impl Unpin for LambLabel
impl UnsafeUnpin for LambLabel
impl UnwindSafe for LambLabel
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.