pub enum PdfObject {
Null,
Bool(bool),
Integer(i64),
Real(f64),
Name(PdfName),
String(PdfString),
HexString(PdfHexString),
Array(PdfArray),
Dict(PdfDict),
Stream(PdfStream),
Reference(PdfRef),
}Expand description
A PDF object that can be any of the basic PDF types
Variants§
Null
Null object
Bool(bool)
Boolean value
Integer(i64)
Integer number
Real(f64)
Real number
Name(PdfName)
Name object (e.g., /Type)
String(PdfString)
Literal string
HexString(PdfHexString)
Hexadecimal string
Array(PdfArray)
Array of objects
Dict(PdfDict)
Dictionary
Stream(PdfStream)
Stream (dictionary + data)
Reference(PdfRef)
Indirect reference (e.g., 1 0 R)
Implementations§
Source§impl PdfObject
impl PdfObject
Sourcepub fn as_bool(&self) -> Option<bool>
pub fn as_bool(&self) -> Option<bool>
Returns the boolean value if this is a Bool, None otherwise
Sourcepub fn as_integer(&self) -> Option<i64>
pub fn as_integer(&self) -> Option<i64>
Returns the integer value if this is an Integer, None otherwise
Sourcepub fn as_real(&self) -> Option<f64>
pub fn as_real(&self) -> Option<f64>
Returns the real value if this is a Real or Integer, None otherwise
Sourcepub fn as_name(&self) -> Option<&PdfName>
pub fn as_name(&self) -> Option<&PdfName>
Returns a reference to the Name if this is a Name, None otherwise
Sourcepub fn as_string(&self) -> Option<&PdfString>
pub fn as_string(&self) -> Option<&PdfString>
Returns a reference to the String if this is a String, None otherwise
Sourcepub fn as_array(&self) -> Option<&PdfArray>
pub fn as_array(&self) -> Option<&PdfArray>
Returns a reference to the Array if this is an Array, None otherwise
Sourcepub fn as_array_mut(&mut self) -> Option<&mut PdfArray>
pub fn as_array_mut(&mut self) -> Option<&mut PdfArray>
Returns a mutable reference to the Array if this is an Array, None otherwise
Sourcepub fn as_dict(&self) -> Option<&PdfDict>
pub fn as_dict(&self) -> Option<&PdfDict>
Returns a reference to the Dict if this is a Dict, None otherwise
Sourcepub fn as_dict_mut(&mut self) -> Option<&mut PdfDict>
pub fn as_dict_mut(&mut self) -> Option<&mut PdfDict>
Returns a mutable reference to the Dict if this is a Dict, None otherwise
Sourcepub fn as_stream(&self) -> Option<&PdfStream>
pub fn as_stream(&self) -> Option<&PdfStream>
Returns a reference to the Stream if this is a Stream, None otherwise
Sourcepub fn as_reference(&self) -> Option<PdfRef>
pub fn as_reference(&self) -> Option<PdfRef>
Returns the Reference if this is a Reference, None otherwise
Trait Implementations§
Source§impl From<PdfHexString> for PdfObject
impl From<PdfHexString> for PdfObject
Source§fn from(s: PdfHexString) -> Self
fn from(s: PdfHexString) -> Self
impl StructuralPartialEq for PdfObject
Auto Trait Implementations§
impl Freeze for PdfObject
impl RefUnwindSafe for PdfObject
impl Send for PdfObject
impl Sync for PdfObject
impl Unpin for PdfObject
impl UnsafeUnpin for PdfObject
impl UnwindSafe for PdfObject
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§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
Source§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
T, using the provided data to resolve any offsets.