pub enum Object {
Null,
Bool(bool),
Integer(i64),
Real(f64),
String(PdfString),
Name(Name),
Array(Vec<Object>),
Dict(Dict),
Stream(Stream),
Ref(ObjRef),
}Expand description
A PDF object.
Added in 0.2.0.
Variants§
Null
null.
Bool(bool)
true / false.
Integer(i64)
An integer.
Real(f64)
A real number.
String(PdfString)
A literal or hex string.
Name(Name)
A name.
Array(Vec<Object>)
An array.
Dict(Dict)
A dictionary.
Stream(Stream)
A stream (only valid as the direct value of an indirect object).
Ref(ObjRef)
An indirect reference.
Implementations§
Source§impl Object
impl Object
Sourcepub fn number(v: f64) -> Self
pub fn number(v: f64) -> Self
v as a number: an integer when it is integral and below 10¹⁵ in magnitude (612,
not 612.0), else a real. PDF has no NaN or infinity, so a non-finite v is 0.
Added in 0.2.0.
Sourcepub fn rounded(v: f64, decimals: u8) -> Self
pub fn rounded(v: f64, decimals: u8) -> Self
v rounded to decimals decimal places (at most 15; more count as 15), then written
as Object::number writes it: rounded(v, 0) is the nearest integer.
Added in 0.2.0.
Sourcepub fn as_dict(&self) -> Option<&Dict>
pub fn as_dict(&self) -> Option<&Dict>
The dictionary, if this is a dictionary (or a stream’s dictionary).
Added in 0.2.0.
Trait Implementations§
impl StructuralPartialEq for Object
Auto Trait Implementations§
impl Forget for Object
impl Freeze for Object
impl Move for Object
impl RefUnwindSafe for Object
impl Send for Object
impl Sync for Object
impl Unpin for Object
impl UnsafeUnpin for Object
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