#[non_exhaustive]pub struct MetadataEntry {
pub name: String,
pub value: Option<Vec<u8>>,
}Expand description
A single metadata entry from a METADATA response (RFC 5464 Section 4.4).
Each entry has a name (e.g. /private/comment) and an optional value.
A None value indicates the entry does not exist or has been deleted.
RFC 5464 Section 5 formal syntax: value = nstring / literal8.
The literal8 form (~{n}\r\n<data>) allows arbitrary binary octets,
so the value is stored as raw bytes rather than a UTF-8 string.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: StringEntry name (e.g. /private/comment, /shared/vendor/foo) (RFC 5464 Section 3.2).
value: Option<Vec<u8>>Entry value as raw bytes, or None if the entry does not exist (RFC 5464 Section 4.4).
RFC 5464 Section 5: value = nstring / literal8 — values may contain
arbitrary binary data via the literal8 syntax, so Vec<u8> is used
instead of String to preserve binary fidelity.
Trait Implementations§
Source§impl Clone for MetadataEntry
impl Clone for MetadataEntry
Source§fn clone(&self) -> MetadataEntry
fn clone(&self) -> MetadataEntry
Returns a duplicate of the value. Read more
1.0.0 · 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 MetadataEntry
impl Debug for MetadataEntry
Source§impl Default for MetadataEntry
impl Default for MetadataEntry
Source§fn default() -> MetadataEntry
fn default() -> MetadataEntry
Returns the “default value” for a type. Read more
Source§impl Hash for MetadataEntry
impl Hash for MetadataEntry
Source§impl PartialEq for MetadataEntry
impl PartialEq for MetadataEntry
impl Eq for MetadataEntry
impl StructuralPartialEq for MetadataEntry
Auto Trait Implementations§
impl Freeze for MetadataEntry
impl RefUnwindSafe for MetadataEntry
impl Send for MetadataEntry
impl Sync for MetadataEntry
impl Unpin for MetadataEntry
impl UnsafeUnpin for MetadataEntry
impl UnwindSafe for MetadataEntry
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