pub struct Label<'computed> { /* private fields */ }
Expand description
A textual label for some value.
Implementations§
source§impl<'computed> Label<'computed>
impl<'computed> Label<'computed>
sourcepub const fn new(label: &'static str) -> Self
pub const fn new(label: &'static str) -> Self
Create a new label from a static string value.
For labels that can’t satisfy the 'static
lifetime, use Label::new_computed
.
For labels that need owned values, use Label::new_owned
.
sourcepub const fn new_computed(label: &'computed str) -> Self
pub const fn new_computed(label: &'computed str) -> Self
Create a new label from a string value borrowed for the 'computed
lifetime.
sourcepub const fn as_static_str(&self) -> Option<&'static str>
pub const fn as_static_str(&self) -> Option<&'static str>
Try get the value of the label as a static string.
For labels that were created over computed data this method will return None
.
Trait Implementations§
source§impl<'a, 'b> PartialEq<Label<'b>> for Label<'a>
impl<'a, 'b> PartialEq<Label<'b>> for Label<'a>
impl<'a> Eq for Label<'a>
impl<'computed> Send for Label<'computed>
impl<'computed> Sync for Label<'computed>
Auto Trait Implementations§
impl<'computed> RefUnwindSafe for Label<'computed>
impl<'computed> Unpin for Label<'computed>
impl<'computed> UnwindSafe for Label<'computed>
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