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((u32, u16)),
}
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((u32, u16))
Implementations§
Source§impl Object
impl Object
pub fn string_literal<S>(s: S) -> Object
pub fn is_null(&self) -> bool
pub fn as_bool(&self) -> Result<bool, Error>
pub fn as_i64(&self) -> Result<i64, Error>
pub fn as_f32(&self) -> Result<f32, Error>
Sourcepub fn as_float(&self) -> Result<f32, Error>
pub fn as_float(&self) -> Result<f32, Error>
Get the object value as a float.
Unlike Object::as_f32
this will also cast an Integer to a Real.
pub fn as_name(&self) -> Result<&[u8], Error>
pub fn as_str(&self) -> Result<&[u8], Error>
pub fn as_str_mut(&mut self) -> Result<&mut Vec<u8>, Error>
pub fn as_reference(&self) -> Result<(u32, u16), Error>
pub fn as_array(&self) -> Result<&Vec<Object>, Error>
pub fn as_array_mut(&mut self) -> Result<&mut Vec<Object>, Error>
pub fn as_dict(&self) -> Result<&Dictionary, Error>
pub fn as_dict_mut(&mut self) -> Result<&mut Dictionary, Error>
pub fn as_stream(&self) -> Result<&Stream, Error>
pub fn as_stream_mut(&mut self) -> Result<&mut Stream, Error>
pub fn type_name(&self) -> Result<&[u8], Error>
pub fn enum_variant(&self) -> &'static str
Trait Implementations§
Source§impl From<Dictionary> for Object
impl From<Dictionary> for Object
Source§fn from(dict: Dictionary) -> Object
fn from(dict: Dictionary) -> Object
Converts to this type from the input type.
impl StructuralPartialEq for Object
Auto Trait Implementations§
impl Freeze for Object
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