Skip to main content

COSObject

Enum COSObject 

Source
pub enum COSObject {
    Null,
    Boolean(bool),
    Integer(i64),
    Real(f64),
    String(COSString),
    Name(COSName),
    Array(COSArray),
    Dictionary(COSDictionary),
    Stream(COSStream),
    Reference(ObjectId),
}
Expand description

The fundamental COS Object enum in PDF.

Variants§

§

Null

§

Boolean(bool)

§

Integer(i64)

§

Real(f64)

§

String(COSString)

§

Name(COSName)

§

Array(COSArray)

§

Dictionary(COSDictionary)

§

Stream(COSStream)

§

Reference(ObjectId)

Implementations§

Source§

impl COSObject

Source

pub const fn null() -> Self

Source

pub fn type_name(&self) -> &'static str

Source

pub fn as_integer(&self) -> Option<i64>

Source

pub fn as_float(&self) -> Option<f64>

Source

pub fn as_bool(&self) -> Option<bool>

Source

pub fn as_name(&self) -> Option<&str>

Source

pub fn as_string(&self) -> Option<&COSString>

Source

pub fn as_dict(&self) -> Option<&COSDictionary>

Source

pub fn as_dict_mut(&mut self) -> Option<&mut COSDictionary>

Source

pub fn as_array(&self) -> Option<&COSArray>

Source

pub fn as_stream(&self) -> Option<&COSStream>

Source

pub fn as_reference(&self) -> Option<ObjectId>

Trait Implementations§

Source§

impl Clone for COSObject

Source§

fn clone(&self) -> COSObject

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for COSObject

Source§

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

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

impl From<&str> for COSObject

Source§

fn from(s: &str) -> Self

Converts to this type from the input type.
Source§

impl From<COSArray> for COSObject

Source§

fn from(a: COSArray) -> Self

Converts to this type from the input type.
Source§

impl From<COSDictionary> for COSObject

Source§

fn from(d: COSDictionary) -> Self

Converts to this type from the input type.
Source§

impl From<COSName> for COSObject

Source§

fn from(n: COSName) -> Self

Converts to this type from the input type.
Source§

impl From<COSStream> for COSObject

Source§

fn from(s: COSStream) -> Self

Converts to this type from the input type.
Source§

impl From<COSString> for COSObject

Source§

fn from(s: COSString) -> Self

Converts to this type from the input type.
Source§

impl From<ObjectId> for COSObject

Source§

fn from(id: ObjectId) -> Self

Converts to this type from the input type.
Source§

impl From<PDRectangle> for COSObject

Source§

fn from(rect: PDRectangle) -> Self

Converts to this type from the input type.
Source§

impl From<String> for COSObject

Source§

fn from(s: String) -> Self

Converts to this type from the input type.
Source§

impl From<bool> for COSObject

Source§

fn from(b: bool) -> Self

Converts to this type from the input type.
Source§

impl From<f32> for COSObject

Source§

fn from(f: f32) -> Self

Converts to this type from the input type.
Source§

impl From<f64> for COSObject

Source§

fn from(f: f64) -> Self

Converts to this type from the input type.
Source§

impl From<i32> for COSObject

Source§

fn from(i: i32) -> Self

Converts to this type from the input type.
Source§

impl From<i64> for COSObject

Source§

fn from(i: i64) -> Self

Converts to this type from the input type.
Source§

impl From<u32> for COSObject

Source§

fn from(i: u32) -> Self

Converts to this type from the input type.
Source§

impl From<usize> for COSObject

Source§

fn from(i: usize) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for COSObject

Source§

fn eq(&self, other: &COSObject) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for COSObject

Auto Trait Implementations§

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
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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.

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V