Enum imessage_database::util::typedstream::models::Archivable
source · pub enum Archivable {
Object(Class, Vec<OutputData>),
Data(Vec<OutputData>),
Class(Class),
Placeholder,
Type(Vec<Type>),
}Expand description
Types of data that can be archived into the typedstream
Variants§
Object(Class, Vec<OutputData>)
An instance of a class that may contain some embedded data. typedstream data doesn’t include property
names, so data is stored in order of appearance.
Data(Vec<OutputData>)
Some data that is likely a property on the object described by the typedstream but not part of a class.
Class(Class)
A class referenced in the typedstream, usually part of an inheritance heirarchy that does not contain any data itself.
Placeholder
A placeholder, only used when reserving a spot in the objects table for a reference to be filled with read class information.
In a typedstream, the classes are stored in order of inheritance, so the top-level class described by the typedstream
comes before the ones it inherits from. To preserve the order, we reserve the first slot to store the actual object’s data
and then later add it back to the right place.
Type(Vec<Type>)
A type that made it through the parsing process without getting replaced by an object.``
Implementations§
source§impl Archivable
impl Archivable
sourcepub fn deserialize_as_nsstring(&self) -> Option<&str>
pub fn deserialize_as_nsstring(&self) -> Option<&str>
If self is an Object that contains a Class named NSString or NSMutableString,
extract a Rust string slice from the associated Data.
§Example
use imessage_database::util::typedstream::models::{Archivable, Class, OutputData};
let nsstring = Archivable::Object(
Class {
name: "NSString".to_string(),
version: 1
},
vec![OutputData::String("Hello world".to_string())]
);
println!("{:?}", nsstring.deserialize_as_nsstring()); // Some("Hello world")
let not_nsstring = Archivable::Object(
Class {
name: "NSNumber".to_string(),
version: 1
},
vec![OutputData::SignedInteger(100)]
);
println!("{:?}", not_nsstring.deserialize_as_nsstring()); // NoneTrait Implementations§
source§impl Clone for Archivable
impl Clone for Archivable
source§fn clone(&self) -> Archivable
fn clone(&self) -> Archivable
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for Archivable
impl Debug for Archivable
source§impl PartialEq for Archivable
impl PartialEq for Archivable
impl StructuralPartialEq for Archivable
Auto Trait Implementations§
impl Freeze for Archivable
impl RefUnwindSafe for Archivable
impl Send for Archivable
impl Sync for Archivable
impl Unpin for Archivable
impl UnwindSafe for Archivable
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)