pub struct Record<'a> { /* private fields */ }Expand description
A map of named Values.
Record is the body of an object in the manifest. On the save side each call to
crate::save::Save::save returns one, and Record::into_value wraps it as a
Versioned Value::Object ready for insertion into another record; on the load
side the same record is read back through crate::load::Object. Keys beginning
with $ are reserved for framework metadata (see [crate::is_reserved]).
Implementations§
Source§impl<'a> Record<'a>
impl<'a> Record<'a>
Sourcepub fn contains_key(&self, key: &str) -> bool
pub fn contains_key(&self, key: &str) -> bool
Returns true if a value is registered under key.
Sourcepub fn get(&self, key: &str) -> Option<&Value<'a>>
pub fn get(&self, key: &str) -> Option<&Value<'a>>
Look up the Value registered under key, if any.
Sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
Number of (user) keys in this record. Reserved keys ($version, $handle)
are tracked elsewhere and never appear here.
Sourcepub fn keys(&self) -> Keys<'_, 'a> ⓘ
pub fn keys(&self) -> Keys<'_, 'a> ⓘ
Iterate over the user keys in this record. Order is unspecified.
Sourcepub fn into_value(self, version: Version) -> Value<'a>
pub fn into_value(self, version: Version) -> Value<'a>
Sourcepub fn into_owned(self) -> Record<'static>
pub fn into_owned(self) -> Record<'static>
Convert this record into a fully owned Record<'static>, deep-copying borrowed
keys and values. See Value::into_owned.