pub struct NonSensitiveMetadata(/* private fields */);Expand description
Flat metadata whose keys have passed credential-sensitivity checks.
UserMetadata stores ordered string pairs and rejects credential-like
keys when each pair is added. This type’s Debug implementation prints
keys only and never automatically exposes values.
The inner UserMetadata is not mutably exposed, so every value of this
type retains the wrapper invariant after construction.
§Examples
use qubit_fs::metadata::{NonSensitiveMetadata, UserMetadata};
let safe = NonSensitiveMetadata::from(
UserMetadata::new().with("content-language", "en")?,
);
assert_eq!(Some("en"), safe.get("content-language"));Implementations§
Source§impl NonSensitiveMetadata
impl NonSensitiveMetadata
Sourcepub const fn as_metadata(&self) -> &UserMetadata
pub const fn as_metadata(&self) -> &UserMetadata
Returns the validated metadata without mutable access.
Sourcepub fn into_metadata(self) -> UserMetadata
pub fn into_metadata(self) -> UserMetadata
Consumes this wrapper and returns the underlying metadata.
Sourcepub fn contains_key(&self, key: &str) -> bool
pub fn contains_key(&self, key: &str) -> bool
Returns whether a metadata key is present.
Trait Implementations§
Source§impl AsRef<UserMetadata> for NonSensitiveMetadata
impl AsRef<UserMetadata> for NonSensitiveMetadata
Source§fn as_ref(&self) -> &UserMetadata
fn as_ref(&self) -> &UserMetadata
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl Clone for NonSensitiveMetadata
impl Clone for NonSensitiveMetadata
Source§impl Debug for NonSensitiveMetadata
impl Debug for NonSensitiveMetadata
Source§impl Default for NonSensitiveMetadata
impl Default for NonSensitiveMetadata
Source§impl From<NonSensitiveMetadata> for UserMetadata
impl From<NonSensitiveMetadata> for UserMetadata
Source§fn from(metadata: NonSensitiveMetadata) -> Self
fn from(metadata: NonSensitiveMetadata) -> Self
Converts to this type from the input type.
Source§impl From<UserMetadata> for NonSensitiveMetadata
impl From<UserMetadata> for NonSensitiveMetadata
Source§fn from(metadata: UserMetadata) -> Self
fn from(metadata: UserMetadata) -> Self
Wraps arbitrary user metadata.
Source§impl PartialEq for NonSensitiveMetadata
impl PartialEq for NonSensitiveMetadata
impl StructuralPartialEq for NonSensitiveMetadata
Auto Trait Implementations§
impl Freeze for NonSensitiveMetadata
impl RefUnwindSafe for NonSensitiveMetadata
impl Send for NonSensitiveMetadata
impl Sync for NonSensitiveMetadata
impl Unpin for NonSensitiveMetadata
impl UnsafeUnpin for NonSensitiveMetadata
impl UnwindSafe for NonSensitiveMetadata
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