pub struct Annotation { /* private fields */ }Expand description
A single annotation key-value pair.
Implementations§
Source§impl Annotation
impl Annotation
Sourcepub const fn new(key: AnnotationKey, value: AnnotationValue) -> Self
pub const fn new(key: AnnotationKey, value: AnnotationValue) -> Self
Creates an annotation from a key and value.
Sourcepub const fn key(&self) -> &AnnotationKey
pub const fn key(&self) -> &AnnotationKey
Returns the annotation key.
Sourcepub const fn value(&self) -> &AnnotationValue
pub const fn value(&self) -> &AnnotationValue
Returns the annotation value.
Sourcepub fn into_parts(self) -> (AnnotationKey, AnnotationValue)
pub fn into_parts(self) -> (AnnotationKey, AnnotationValue)
Splits the annotation into its key and value.
Trait Implementations§
Source§impl Clone for Annotation
impl Clone for Annotation
Source§fn clone(&self) -> Annotation
fn clone(&self) -> Annotation
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 Annotation
impl Debug for Annotation
Source§impl PartialEq for Annotation
impl PartialEq for Annotation
Source§fn eq(&self, other: &Annotation) -> bool
fn eq(&self, other: &Annotation) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for Annotation
impl StructuralPartialEq for Annotation
Auto Trait Implementations§
impl Freeze for Annotation
impl RefUnwindSafe for Annotation
impl Send for Annotation
impl Sync for Annotation
impl Unpin for Annotation
impl UnsafeUnpin for Annotation
impl UnwindSafe for Annotation
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