[−][src]Enum pdf::primitive::Primitive
Variants
Integer(i32)
Number(f32)
Boolean(bool)
String(PdfString)
Stream(PdfStream)
Dictionary(Dictionary)
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 to_reference(self) -> Result<PlainRef>
[src]
pub fn to_array(self, r: &impl Resolve) -> Result<Vec<Primitive>>
[src]
Does accept a Reference
pub fn to_dictionary(self, r: &impl Resolve) -> Result<Dictionary>
[src]
pub fn to_name(self) -> Result<String>
[src]
Doesn't accept a Reference
pub fn to_string(self) -> Result<PdfString>
[src]
Doesn't accept a Reference
pub fn to_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]
fn from(x: Dictionary) -> 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>> 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]
fn serialize<W: Write>(&self, out: &mut W) -> Result<()>
[src]
fn from_primitive(p: Primitive, _: &impl Resolve) -> Result<Self>
[src]
fn from_dict(dict: Dictionary, resolve: &impl Resolve) -> Result<Self>
[src]
impl<'a> TryInto<&'a [Primitive]> for &'a Primitive
[src]
type Error = PdfError
The type returned in the event of a conversion error.
fn try_into(self) -> Result<&'a [Primitive]>
[src]
impl<'a> TryInto<&'a [u8]> for &'a Primitive
[src]
type Error = PdfError
The type returned in the event of a conversion error.
fn try_into(self) -> Result<&'a [u8]>
[src]
impl<'a> TryInto<Cow<'a, str>> for &'a Primitive
[src]
type Error = PdfError
The type returned in the event of a conversion error.
fn try_into(self) -> Result<Cow<'a, str>>
[src]
impl<'a> TryInto<String> for &'a Primitive
[src]
type Error = PdfError
The type returned in the event of a conversion error.
fn try_into(self) -> Result<String>
[src]
impl<'a> TryInto<f32> for &'a Primitive
[src]
type Error = PdfError
The type returned in the event of a conversion error.
fn try_into(self) -> Result<f32>
[src]
impl<'a> TryInto<i32> for &'a Primitive
[src]
Auto Trait Implementations
impl RefUnwindSafe for Primitive
impl Send for Primitive
impl Sync for Primitive
impl Unpin for Primitive
impl UnwindSafe for Primitive
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> AnyObject for T where
T: Object + 'static,
[src]
T: Object + 'static,
fn serialize(&Self, &mut Vec<u8>)
[src]
fn type_name(&Self) -> &'static str
[src]
fn type_id(&Self) -> TypeId
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,