pub enum Primitive {
Null,
Integer(i32),
Number(f32),
Boolean(bool),
String(PdfString),
Stream(PdfStream),
Dictionary(Dictionary),
Array(Vec<Primitive>),
Reference(PlainRef),
Name(SmallString),
}Variants§
Null
Integer(i32)
Number(f32)
Boolean(bool)
String(PdfString)
Stream(PdfStream)
Dictionary(Dictionary)
Array(Vec<Primitive>)
Reference(PlainRef)
Name(SmallString)
Implementations§
Source§impl Primitive
impl Primitive
Sourcepub fn get_debug_name(&self) -> &'static str
pub fn get_debug_name(&self) -> &'static str
For debugging / error messages: get the name of the variant
Sourcepub fn resolve(self, r: &impl Resolve) -> Result<Primitive>
pub fn resolve(self, r: &impl Resolve) -> Result<Primitive>
resolve the primitive if it is a refernce, otherwise do nothing
pub fn as_integer(&self) -> Result<i32>
pub fn as_u8(&self) -> Result<u8>
pub fn as_u32(&self) -> Result<u32>
pub fn as_usize(&self) -> Result<usize>
pub fn as_number(&self) -> Result<f32>
pub fn as_bool(&self) -> Result<bool>
pub fn as_name(&self) -> Result<&str>
pub fn as_string(&self) -> Result<&PdfString>
pub fn as_array(&self) -> Result<&[Primitive]>
pub fn into_reference(self) -> Result<PlainRef>
pub fn into_array(self) -> Result<Vec<Primitive>>
pub fn into_dictionary(self) -> Result<Dictionary>
pub fn into_name(self) -> Result<Name>
pub fn into_string(self) -> Result<PdfString>
pub fn to_string_lossy(&self) -> Result<String>
pub fn to_string(&self) -> Result<String>
pub fn into_stream(self, _r: &impl Resolve) -> Result<PdfStream>
Trait Implementations§
Source§impl DataSize for Primitive
impl DataSize for Primitive
Source§const IS_DYNAMIC: bool = true
const IS_DYNAMIC: bool = true
If
true, the type has a heap size that can vary at runtime, depending on the actual value.Source§const STATIC_HEAP_SIZE: usize = 112usize
const STATIC_HEAP_SIZE: usize = 112usize
The amount of space a value of the type always occupies. If
IS_DYNAMIC is false, this is
the total amount of heap memory occupied by the value. Otherwise this is a lower bound.Source§fn estimate_heap_size(&self) -> usize
fn estimate_heap_size(&self) -> usize
Estimates the size of heap memory taken up by this value. Read more
Source§impl DeepClone for Primitive
impl DeepClone for Primitive
fn deep_clone(&self, cloner: &mut impl Cloner) -> Result<Self>
Source§impl From<Dictionary> for Primitive
impl From<Dictionary> for Primitive
Source§fn from(x: Dictionary) -> Primitive
fn from(x: Dictionary) -> Primitive
Converts to this type from the input type.
Source§impl ObjectWrite for Primitive
impl ObjectWrite for Primitive
impl StructuralPartialEq for Primitive
Auto Trait Implementations§
impl Freeze for Primitive
impl RefUnwindSafe for Primitive
impl Send for Primitive
impl Sync for Primitive
impl Unpin for Primitive
impl UnwindSafe for Primitive
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more