pub struct AttributeValue(/* private fields */);Expand description
One validated attribute value.
A value is at most MAX_ATTRIBUTE_VALUE_BYTES UTF-8 bytes. It is
otherwise free text: control characters and the empty string are legal.
Empty is a stored value, not a tombstone; only an explicit remove
operation deletes an attribute.
Implementations§
Source§impl AttributeValue
impl AttributeValue
Sourcepub fn logical_bytes(&self) -> usize
pub fn logical_bytes(&self) -> usize
Returns this value’s logical size in UTF-8 bytes.
The value counts its own bytes and no encoder framing.
Trait Implementations§
Source§impl AsRef<str> for AttributeValue
impl AsRef<str> for AttributeValue
Source§impl Borrow<str> for AttributeValue
impl Borrow<str> for AttributeValue
Source§impl Clone for AttributeValue
impl Clone for AttributeValue
Source§fn clone(&self) -> AttributeValue
fn clone(&self) -> AttributeValue
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 AttributeValue
impl Debug for AttributeValue
Source§impl<'de> Deserialize<'de> for AttributeValue
impl<'de> Deserialize<'de> for AttributeValue
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for AttributeValue
impl Display for AttributeValue
impl Eq for AttributeValue
Source§impl FromStr for AttributeValue
impl FromStr for AttributeValue
Source§impl Hash for AttributeValue
impl Hash for AttributeValue
Source§impl Ord for AttributeValue
impl Ord for AttributeValue
Source§fn cmp(&self, other: &AttributeValue) -> Ordering
fn cmp(&self, other: &AttributeValue) -> 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 AttributeValue
impl PartialEq for AttributeValue
Source§impl PartialOrd for AttributeValue
impl PartialOrd for AttributeValue
Source§impl Serialize for AttributeValue
impl Serialize for AttributeValue
impl StructuralPartialEq for AttributeValue
Source§impl TryFrom<&str> for AttributeValue
impl TryFrom<&str> for AttributeValue
Auto Trait Implementations§
impl Freeze for AttributeValue
impl RefUnwindSafe for AttributeValue
impl Send for AttributeValue
impl Sync for AttributeValue
impl Unpin for AttributeValue
impl UnsafeUnpin for AttributeValue
impl UnwindSafe for AttributeValue
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