[][src]Enum pdf::primitive::Primitive

pub enum Primitive {
    Null,
    Integer(i32),
    Number(f32),
    Boolean(bool),
    String(PdfString),
    Stream(PdfStream),
    Dictionary(Dictionary),
    Array(Vec<Primitive>),
    Reference(PlainRef),
    Name(String),
}

Variants

Null
Integer(i32)
Number(f32)
Boolean(bool)
String(PdfString)
Stream(PdfStream)
Dictionary(Dictionary)
Array(Vec<Primitive>)
Reference(PlainRef)
Name(String)

Implementations

impl Primitive[src]

pub fn get_debug_name(&self) -> &'static str[src]

For debugging / error messages: get the name of the variant

pub fn as_integer(&self) -> Result<i32>[src]

pub fn as_u32(&self) -> Result<u32>[src]

pub fn as_number(&self) -> Result<f32>[src]

pub fn as_bool(&self) -> Result<bool>[src]

pub fn as_name(&self) -> Result<&str>[src]

pub fn as_string(&self) -> Result<&PdfString>[src]

pub fn as_str(&self) -> Option<Cow<'_, str>>[src]

pub fn as_array(&self) -> Result<&[Primitive]>[src]

Does not accept a Reference

pub fn into_reference(self) -> Result<PlainRef>[src]

pub fn into_array(self, r: &impl Resolve) -> Result<Vec<Primitive>>[src]

Does accept a Reference

pub fn into_dictionary(self, r: &impl Resolve) -> Result<Dictionary>[src]

pub fn into_name(self) -> Result<String>[src]

Doesn't accept a Reference

pub fn into_string(self) -> Result<PdfString>[src]

Doesn't accept a Reference

pub fn into_stream(self, _r: &impl Resolve) -> Result<PdfStream>[src]

Doesn't accept a Reference

Trait Implementations

impl Clone for Primitive[src]

impl Debug for Primitive[src]

impl Display for Primitive[src]

impl From<Dictionary> for Primitive[src]

impl From<PdfStream> for Primitive[src]

impl From<PdfString> for Primitive[src]

impl From<PlainRef> for Primitive[src]

impl From<String> for Primitive[src]

impl From<Vec<Primitive, Global>> for Primitive[src]

impl From<bool> for Primitive[src]

impl From<f32> for Primitive[src]

impl From<i32> for Primitive[src]

impl Object for Primitive[src]

impl<'a> TryInto<&'a [Primitive]> for &'a Primitive[src]

type Error = PdfError

The type returned in the event of a conversion error.

impl<'a> TryInto<&'a [u8]> for &'a Primitive[src]

type Error = PdfError

The type returned in the event of a conversion error.

impl<'a> TryInto<Cow<'a, str>> for &'a Primitive[src]

type Error = PdfError

The type returned in the event of a conversion error.

impl<'a> TryInto<String> for &'a Primitive[src]

type Error = PdfError

The type returned in the event of a conversion error.

impl<'a> TryInto<f32> for &'a Primitive[src]

type Error = PdfError

The type returned in the event of a conversion error.

impl<'a> TryInto<i32> for &'a Primitive[src]

type Error = PdfError

The type returned in the event of a conversion error.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> AnyObject for T where
    T: Object + 'static, 
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.