pub struct AnnotationKey(/* private fields */);Expand description
A non-empty annotation key.
Implementations§
Source§impl AnnotationKey
impl AnnotationKey
Sourcepub fn new(value: impl AsRef<str>) -> Result<Self, AnnotationKeyError>
pub fn new(value: impl AsRef<str>) -> Result<Self, AnnotationKeyError>
Creates an annotation key from non-empty text.
§Errors
Returns AnnotationKeyError::Empty when the trimmed key is empty.
Sourcepub fn into_string(self) -> String
pub fn into_string(self) -> String
Consumes the key and returns the owned string.
Trait Implementations§
Source§impl AsRef<str> for AnnotationKey
impl AsRef<str> for AnnotationKey
Source§impl Clone for AnnotationKey
impl Clone for AnnotationKey
Source§fn clone(&self) -> AnnotationKey
fn clone(&self) -> AnnotationKey
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AnnotationKey
impl Debug for AnnotationKey
Source§impl Display for AnnotationKey
impl Display for AnnotationKey
Source§impl FromStr for AnnotationKey
impl FromStr for AnnotationKey
Source§impl Hash for AnnotationKey
impl Hash for AnnotationKey
Source§impl Ord for AnnotationKey
impl Ord for AnnotationKey
Source§fn cmp(&self, other: &AnnotationKey) -> Ordering
fn cmp(&self, other: &AnnotationKey) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for AnnotationKey
impl PartialEq for AnnotationKey
Source§fn eq(&self, other: &AnnotationKey) -> bool
fn eq(&self, other: &AnnotationKey) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for AnnotationKey
impl PartialOrd for AnnotationKey
impl Eq for AnnotationKey
impl StructuralPartialEq for AnnotationKey
Auto Trait Implementations§
impl Freeze for AnnotationKey
impl RefUnwindSafe for AnnotationKey
impl Send for AnnotationKey
impl Sync for AnnotationKey
impl Unpin for AnnotationKey
impl UnsafeUnpin for AnnotationKey
impl UnwindSafe for AnnotationKey
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