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
.