Enum Object

Source
pub enum Object<'a> {
    Null(Null),
    Boolean(bool),
    Number(Number),
    String(String<'a>),
    Name(Name<'a>),
    Dict(Dict<'a>),
    Array(Array<'a>),
    Stream(Stream<'a>),
}
Expand description

A primitive PDF object.

Variants§

§

Null(Null)

A null object.

§

Boolean(bool)

A boolean object.

§

Number(Number)

A number object.

§

String(String<'a>)

A string object.

§

Name(Name<'a>)

A name object.

§

Dict(Dict<'a>)

A dict object.

§

Array(Array<'a>)

An array object.

§

Stream(Stream<'a>)

A stream object.

Implementations§

Source§

impl<'a> Object<'a>

Source

pub fn into_dict(self) -> Option<Dict<'a>>

Try casting the object to a dict.

Source

pub fn into_name(self) -> Option<Name<'a>>

Try casting the object to a name.

Source

pub fn into_null(self) -> Option<Null>

Try casting the object to the null object.

Source

pub fn into_bool(self) -> Option<bool>

Try casting the object to a bool.

Source

pub fn into_string(self) -> Option<String<'a>>

Try casting the object to a string.

Source

pub fn into_stream(self) -> Option<Stream<'a>>

Try casting the object to a stream.

Source

pub fn into_array(self) -> Option<Array<'a>>

Try casting the object to an array.

Source

pub fn into_u8(self) -> Option<u8>

Try casting the object to a u8.

Source

pub fn into_u16(self) -> Option<u16>

Try casting the object to a u16.

Source

pub fn into_f32(self) -> Option<f32>

Try casting the object to a f32.

Source

pub fn into_i32(self) -> Option<i32>

Try casting the object to a i32.

Source

pub fn into_number(self) -> Option<Number>

Try casting the object to a number.

Trait Implementations§

Source§

impl<'a> Clone for Object<'a>

Source§

fn clone(&self) -> Object<'a>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for Object<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> PartialEq for Object<'a>

Source§

fn eq(&self, other: &Object<'a>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl TryFrom<Object<'_>> for Rect

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: Object<'_>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Object<'_>> for f32

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: Object<'_>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Object<'_>> for f64

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: Object<'_>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Object<'_>> for i32

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: Object<'_>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Object<'_>> for u16

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: Object<'_>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Object<'_>> for u32

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: Object<'_>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Object<'_>> for u8

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: Object<'_>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Object<'_>> for usize

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: Object<'_>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'a, T: ObjectLike<'a> + Copy + Default, const C: usize> TryFrom<Object<'a>> for [T; C]
where [T; C]: TryFrom<Array<'a>, Error = ()>,

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: Object<'a>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'a, T, U> TryFrom<Object<'a>> for (T, U)
where T: ObjectLike<'a>, U: ObjectLike<'a>,

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(_: Object<'a>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'a, T, U, V> TryFrom<Object<'a>> for (T, U, V)
where T: ObjectLike<'a>, U: ObjectLike<'a>, V: ObjectLike<'a>,

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(_: Object<'a>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'a, T, U, V, W> TryFrom<Object<'a>> for (T, U, V, W)
where T: ObjectLike<'a>, U: ObjectLike<'a>, V: ObjectLike<'a>, W: ObjectLike<'a>,

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(_: Object<'a>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'a, T, U, V, W, X> TryFrom<Object<'a>> for (T, U, V, W, X)
where T: ObjectLike<'a>, U: ObjectLike<'a>, V: ObjectLike<'a>, W: ObjectLike<'a>, X: ObjectLike<'a>,

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(_: Object<'a>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'a> TryFrom<Object<'a>> for Array<'a>

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: Object<'a>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'a> TryFrom<Object<'a>> for Dict<'a>

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: Object<'a>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'a> TryFrom<Object<'a>> for Name<'a>

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: Object<'a>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'a> TryFrom<Object<'a>> for Null

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: Object<'a>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'a> TryFrom<Object<'a>> for Number

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: Object<'a>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'a, U: ObjectLike<'a>, T: ObjectLike<'a> + Array<Item = U>> TryFrom<Object<'a>> for SmallVec<T>

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: Object<'a>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'a> TryFrom<Object<'a>> for Stream<'a>

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: Object<'a>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'a> TryFrom<Object<'a>> for String<'a>

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: Object<'a>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'a, T: ObjectLike<'a>> TryFrom<Object<'a>> for Vec<T>

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: Object<'a>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'a> TryFrom<Object<'a>> for bool

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: Object<'a>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'a> StructuralPartialEq for Object<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for Object<'a>

§

impl<'a> !RefUnwindSafe for Object<'a>

§

impl<'a> Send for Object<'a>

§

impl<'a> Sync for Object<'a>

§

impl<'a> Unpin for Object<'a>

§

impl<'a> !UnwindSafe for Object<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.