pub enum Object {
Null,
Boolean(bool),
Integer(i64),
Real(f32),
Name(Vec<u8>),
String(Vec<u8>, StringFormat),
Array(Vec<Object>),
Dictionary(Dictionary),
Stream(Stream),
Reference(ObjectId),
}
Expand description
Basic PDF object types defined in an enum.
Variants§
Null
Boolean(bool)
Integer(i64)
Real(f32)
Name(Vec<u8>)
String(Vec<u8>, StringFormat)
Array(Vec<Object>)
Dictionary(Dictionary)
Stream(Stream)
Reference(ObjectId)
Implementations§
source§impl Object
impl Object
pub fn string_literal<S: Into<Vec<u8>>>(s: S) -> Self
pub fn is_null(&self) -> bool
pub fn as_bool(&self) -> Result<bool>
pub fn as_i64(&self) -> Result<i64>
pub fn as_f32(&self) -> Result<f32>
sourcepub fn as_float(&self) -> Result<f32>
pub fn as_float(&self) -> Result<f32>
Get the object value as a float. Unlike as_f64() this will also cast an Integer to a Real.
pub fn as_name(&self) -> Result<&[u8]>
pub fn as_name_str(&self) -> Result<&str>
pub fn as_str(&self) -> Result<&[u8]>
pub fn as_str_mut(&mut self) -> Result<&mut Vec<u8>>
pub fn as_string(&self) -> Result<Cow<'_, str>>
pub fn as_reference(&self) -> Result<ObjectId>
pub fn as_array(&self) -> Result<&Vec<Object>>
pub fn as_array_mut(&mut self) -> Result<&mut Vec<Object>>
pub fn as_dict(&self) -> Result<&Dictionary>
pub fn as_dict_mut(&mut self) -> Result<&mut Dictionary>
pub fn as_stream(&self) -> Result<&Stream>
pub fn as_stream_mut(&mut self) -> Result<&mut Stream>
pub fn type_name(&self) -> Result<&str>
Trait Implementations§
source§impl From<Dictionary> for Object
impl From<Dictionary> for Object
source§fn from(dict: Dictionary) -> Self
fn from(dict: Dictionary) -> Self
Converts to this type from the input type.
source§impl From<OffsetDateTime> for Object
impl From<OffsetDateTime> for Object
source§fn from(date: OffsetDateTime) -> Self
fn from(date: OffsetDateTime) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl RefUnwindSafe for Object
impl Send for Object
impl Sync for Object
impl Unpin 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