pub enum ObjectData<'a> {
Empty,
Inline(OutputData<'a>),
Groups(Vec<Vec<OutputData<'a>>>),
}Expand description
The data attached to an Archived::Object.
typedstream objects store their values in one or more groups (each group
is the result of decoding one type descriptor). In practice the overwhelming
majority of objects hold a single group containing a single value (an
NSString’s text, an NSNumber’s number, a reference to another object) so
that case is stored inline without any heap allocation. Only objects with
multiple groups, or a group holding multiple values, fall back to the nested
Vec representation.
Variants§
Empty
The object has no data groups.
Inline(OutputData<'a>)
A single group containing a single value, stored inline. This is by far the most common shape and avoids two heap allocations per object.
Groups(Vec<Vec<OutputData<'a>>>)
The general case: one or more groups, each holding one or more values.
Implementations§
Source§impl<'a> ObjectData<'a>
impl<'a> ObjectData<'a>
Sourcepub fn group_count(&self) -> usize
pub fn group_count(&self) -> usize
The number of data groups in this object.
Trait Implementations§
Source§impl<'a> Debug for ObjectData<'a>
impl<'a> Debug for ObjectData<'a>
Source§impl<'a> PartialEq for ObjectData<'a>
impl<'a> PartialEq for ObjectData<'a>
Source§fn eq(&self, other: &ObjectData<'a>) -> bool
fn eq(&self, other: &ObjectData<'a>) -> bool
self and other values to be equal, and is used by ==.