pub enum Object {
Null,
Boolean(bool),
Integer(i64),
Real(f64),
Name(Vec<u8>),
String(Vec<u8>, StringFormat),
Array(Vec<Object>),
Dictionary(Dictionary),
Stream(Stream),
Reference(ObjectId),
}Expand description
A PDF object.
Variants§
Null
null, and what a reference to a missing object resolves to.
Boolean(bool)
true or false.
Integer(i64)
An integer.
Real(f64)
A real number.
Name(Vec<u8>)
A name, without the leading /, with #xx escapes decoded.
String(Vec<u8>, StringFormat)
A string’s bytes, after unescaping (and after decryption).
Array(Vec<Object>)
An array.
Dictionary(Dictionary)
A dictionary.
Stream(Stream)
A stream: a dictionary and bytes.
Reference(ObjectId)
A reference to an indirect object.
Implementations§
Source§impl Object
impl Object
Sourcepub fn as_i64(&self) -> Result<i64>
pub fn as_i64(&self) -> Result<i64>
The integer value. A real with no fractional part counts, because
writers do emit 612.0 where an integer belongs.
Sourcepub fn as_array_mut(&mut self) -> Result<&mut Vec<Object>>
pub fn as_array_mut(&mut self) -> Result<&mut Vec<Object>>
The array, mutably.
Sourcepub fn as_dict(&self) -> Result<&Dictionary>
pub fn as_dict(&self) -> Result<&Dictionary>
The dictionary. A stream answers with its dictionary.
Sourcepub fn as_dict_mut(&mut self) -> Result<&mut Dictionary>
pub fn as_dict_mut(&mut self) -> Result<&mut Dictionary>
The dictionary, mutably. A stream answers with its dictionary.
Sourcepub fn as_stream_mut(&mut self) -> Result<&mut Stream>
pub fn as_stream_mut(&mut self) -> Result<&mut Stream>
The stream, mutably.
Sourcepub fn as_reference(&self) -> Result<ObjectId>
pub fn as_reference(&self) -> Result<ObjectId>
The reference’s target.
Trait Implementations§
Source§impl From<&str> for Object
A &str becomes a name, which is what dictionary values written by
hand almost always are ("Type" => "Page"). Use Object::string for a
string.
impl From<&str> for Object
A &str becomes a name, which is what dictionary values written by
hand almost always are ("Type" => "Page"). Use Object::string for a
string.
Source§impl From<Dictionary> for Object
impl From<Dictionary> for Object
Source§fn from(v: Dictionary) -> Self
fn from(v: Dictionary) -> Self
Converts to this type from the input type.
impl StructuralPartialEq for Object
Auto Trait Implementations§
impl Forget for Object
impl Freeze for Objectwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<Object>: Freeze,
*const LeafNode<Vec<u8>, Object> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(Vec<u8>, Object)>>: Freeze,
*const ArcInner<[u8]> is !null: Freeze,
PhantomData<ArcInner<[u8]>>: Freeze,
impl Move for Object
impl RefUnwindSafe for Object
impl Send for Object
impl Sync for Object
impl Unpin for Object
impl UnsafeUnpin for Objectwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<Object>: UnsafeUnpin,
*const LeafNode<Vec<u8>, Object> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(Vec<u8>, Object)>>: UnsafeUnpin,
*const ArcInner<[u8]> is !null: UnsafeUnpin,
PhantomData<ArcInner<[u8]>>: UnsafeUnpin,
impl UnwindSafe for Object
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