pub struct MetadataKey(/* private fields */);Implementations§
Source§impl MetadataKey
impl MetadataKey
Sourcepub fn new(value: impl AsRef<str>) -> Result<Self, ApiPrimitiveError>
pub fn new(value: impl AsRef<str>) -> Result<Self, ApiPrimitiveError>
Creates validated text metadata.
§Errors
Returns ApiPrimitiveError when the value is empty or contains control characters.
Sourcepub fn into_string(self) -> String
pub fn into_string(self) -> String
Consumes the value and returns the stored text.
Trait Implementations§
Source§impl AsRef<str> for MetadataKey
impl AsRef<str> for MetadataKey
Source§impl Clone for MetadataKey
impl Clone for MetadataKey
Source§fn clone(&self) -> MetadataKey
fn clone(&self) -> MetadataKey
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 MetadataKey
impl Debug for MetadataKey
Source§impl Display for MetadataKey
impl Display for MetadataKey
Source§impl FromStr for MetadataKey
impl FromStr for MetadataKey
Source§impl Hash for MetadataKey
impl Hash for MetadataKey
Source§impl Ord for MetadataKey
impl Ord for MetadataKey
Source§fn cmp(&self, other: &MetadataKey) -> Ordering
fn cmp(&self, other: &MetadataKey) -> 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 MetadataKey
impl PartialEq for MetadataKey
Source§fn eq(&self, other: &MetadataKey) -> bool
fn eq(&self, other: &MetadataKey) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for MetadataKey
impl PartialOrd for MetadataKey
Source§impl TryFrom<&str> for MetadataKey
impl TryFrom<&str> for MetadataKey
impl Eq for MetadataKey
impl StructuralPartialEq for MetadataKey
Auto Trait Implementations§
impl Freeze for MetadataKey
impl RefUnwindSafe for MetadataKey
impl Send for MetadataKey
impl Sync for MetadataKey
impl Unpin for MetadataKey
impl UnsafeUnpin for MetadataKey
impl UnwindSafe for MetadataKey
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