Enum IppValue

Source
pub enum IppValue {
Show 18 variants Integer(i32), Enum(i32), OctetString(String), TextWithoutLanguage(String), NameWithoutLanguage(String), Charset(String), NaturalLanguage(String), Uri(String), RangeOfInteger { min: i32, max: i32, }, Boolean(bool), Keyword(String), ListOf(Vec<IppValue>), Collection(Vec<IppValue>), MimeMediaType(String), DateTime { year: u16, month: u8, day: u8, hour: u8, minutes: u8, seconds: u8, deciseconds: u8, utcdir: char, utchours: u8, utcmins: u8, }, MemberAttrName(String), Resolution { crossfeed: i32, feed: i32, units: i8, }, Other { tag: u8, data: Bytes, },
}
Expand description

IPP value enumeration

Variants§

§

Integer(i32)

§

Enum(i32)

§

OctetString(String)

§

TextWithoutLanguage(String)

§

NameWithoutLanguage(String)

§

Charset(String)

§

NaturalLanguage(String)

§

Uri(String)

§

RangeOfInteger

Fields

§min: i32
§max: i32
§

Boolean(bool)

§

Keyword(String)

§

ListOf(Vec<IppValue>)

§

Collection(Vec<IppValue>)

§

MimeMediaType(String)

§

DateTime

Fields

§year: u16
§month: u8
§day: u8
§hour: u8
§minutes: u8
§seconds: u8
§deciseconds: u8
§utcdir: char
§utchours: u8
§utcmins: u8
§

MemberAttrName(String)

§

Resolution

Fields

§crossfeed: i32
§feed: i32
§units: i8
§

Other

Fields

§tag: u8
§data: Bytes

Implementations§

Source§

impl IppValue

Source

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

Optionally returns references to the inner fields if this is a IppValue::Integer, otherwise None

Source

pub fn as_enum(&self) -> Option<&i32>

Optionally returns references to the inner fields if this is a IppValue::Enum, otherwise None

Source

pub fn as_octetstring(&self) -> Option<&String>

Optionally returns references to the inner fields if this is a IppValue::OctetString, otherwise None

Source

pub fn as_textwithoutlanguage(&self) -> Option<&String>

Optionally returns references to the inner fields if this is a IppValue::TextWithoutLanguage, otherwise None

Source

pub fn as_namewithoutlanguage(&self) -> Option<&String>

Optionally returns references to the inner fields if this is a IppValue::NameWithoutLanguage, otherwise None

Source

pub fn as_charset(&self) -> Option<&String>

Optionally returns references to the inner fields if this is a IppValue::Charset, otherwise None

Source

pub fn as_naturallanguage(&self) -> Option<&String>

Optionally returns references to the inner fields if this is a IppValue::NaturalLanguage, otherwise None

Source

pub fn as_uri(&self) -> Option<&String>

Optionally returns references to the inner fields if this is a IppValue::Uri, otherwise None

Source

pub fn as_rangeofinteger(&self) -> Option<(&i32, &i32)>

Optionally returns references to the inner fields if this is a IppValue::RangeOfInteger, otherwise None

Source

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

Optionally returns references to the inner fields if this is a IppValue::Boolean, otherwise None

Source

pub fn as_keyword(&self) -> Option<&String>

Optionally returns references to the inner fields if this is a IppValue::Keyword, otherwise None

Source

pub fn as_listof(&self) -> Option<&Vec<IppValue>>

Optionally returns references to the inner fields if this is a IppValue::ListOf, otherwise None

Source

pub fn as_collection(&self) -> Option<&Vec<IppValue>>

Optionally returns references to the inner fields if this is a IppValue::Collection, otherwise None

Source

pub fn as_mimemediatype(&self) -> Option<&String>

Optionally returns references to the inner fields if this is a IppValue::MimeMediaType, otherwise None

Source

pub fn as_datetime( &self, ) -> Option<(&u16, &u8, &u8, &u8, &u8, &u8, &u8, &char, &u8, &u8)>

Optionally returns references to the inner fields if this is a IppValue::DateTime, otherwise None

Source

pub fn as_memberattrname(&self) -> Option<&String>

Optionally returns references to the inner fields if this is a IppValue::MemberAttrName, otherwise None

Source

pub fn as_resolution(&self) -> Option<(&i32, &i32, &i8)>

Optionally returns references to the inner fields if this is a IppValue::Resolution, otherwise None

Source

pub fn as_other(&self) -> Option<(&u8, &Bytes)>

Optionally returns references to the inner fields if this is a IppValue::Other, otherwise None

Source§

impl IppValue

Source

pub fn to_tag(&self) -> ValueTag

Convert to binary tag

Source

pub fn read(vtag: u8, reader: &mut dyn Read) -> Result<IppValue>

Read value from binary stream

Trait Implementations§

Source§

impl Clone for IppValue

Source§

fn clone(&self) -> IppValue

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 Debug for IppValue

Source§

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

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

impl Display for IppValue

Implement Display trait to print the value

Source§

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

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

impl<'a> IntoIterator for &'a IppValue

Source§

type Item = &'a IppValue

The type of the elements being iterated over.
Source§

type IntoIter = IppValueIterator<'a>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl PartialEq for IppValue

Source§

fn eq(&self, other: &IppValue) -> 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 StructuralPartialEq for IppValue

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
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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.