Enum ipp::value::IppValue

source ·
pub enum IppValue {
Show 22 variants Integer(i32), Enum(i32), OctetString(String), TextWithoutLanguage(String), NameWithoutLanguage(String), TextWithLanguage { language: String, text: String, }, NameWithLanguage { language: String, name: String, }, Charset(String), NaturalLanguage(String), Uri(String), UriScheme(String), RangeOfInteger { min: i32, max: i32, }, Boolean(bool), Keyword(String), Array(Vec<IppValue>), Collection(BTreeMap<String, IppValue>), MimeMediaType(String), DateTime { year: u16, month: u8, day: u8, hour: u8, minutes: u8, seconds: u8, deci_seconds: u8, utc_dir: char, utc_hours: u8, utc_mins: u8, }, MemberAttrName(String), Resolution { cross_feed: i32, feed: i32, units: i8, }, NoValue, Other { tag: u8, data: Bytes, },
}
Expand description

IPP attribute values as defined in RFC 8010

Variants§

§

Integer(i32)

§

Enum(i32)

§

OctetString(String)

§

TextWithoutLanguage(String)

§

NameWithoutLanguage(String)

§

TextWithLanguage

Fields

§language: String
§text: String
§

NameWithLanguage

Fields

§language: String
§name: String
§

Charset(String)

§

NaturalLanguage(String)

§

Uri(String)

§

UriScheme(String)

§

RangeOfInteger

Fields

§min: i32
§max: i32
§

Boolean(bool)

§

Keyword(String)

§

Array(Vec<IppValue>)

§

Collection(BTreeMap<String, IppValue>)

§

MimeMediaType(String)

§

DateTime

Fields

§year: u16
§month: u8
§day: u8
§hour: u8
§minutes: u8
§seconds: u8
§deci_seconds: u8
§utc_dir: char
§utc_hours: u8
§utc_mins: u8
§

MemberAttrName(String)

§

Resolution

Fields

§cross_feed: i32
§feed: i32
§units: i8
§

NoValue

§

Other

Fields

§tag: u8
§data: Bytes

Implementations§

source§

impl IppValue

source

pub fn is_integer(&self) -> bool

Returns true if this is a IppValue::Integer, otherwise false

source

pub fn as_integer_mut(&mut self) -> Option<&mut i32>

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

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 into_integer(self) -> Result<i32, Self>

Returns the inner fields if this is a IppValue::Integer, otherwise returns back the enum in the Err case of the result

source

pub fn is_enum(&self) -> bool

Returns true if this is a IppValue::Enum, otherwise false

source

pub fn as_enum_mut(&mut self) -> Option<&mut i32>

Optionally returns mutable references to the inner fields if this is a IppValue::Enum, 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 into_enum(self) -> Result<i32, Self>

Returns the inner fields if this is a IppValue::Enum, otherwise returns back the enum in the Err case of the result

source

pub fn is_octet_string(&self) -> bool

Returns true if this is a IppValue::OctetString, otherwise false

source

pub fn as_octet_string_mut(&mut self) -> Option<&mut String>

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

source

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

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

source

pub fn into_octet_string(self) -> Result<String, Self>

Returns the inner fields if this is a IppValue::OctetString, otherwise returns back the enum in the Err case of the result

source

pub fn is_text_without_language(&self) -> bool

Returns true if this is a IppValue::TextWithoutLanguage, otherwise false

source

pub fn as_text_without_language_mut(&mut self) -> Option<&mut String>

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

source

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

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

source

pub fn into_text_without_language(self) -> Result<String, Self>

Returns the inner fields if this is a IppValue::TextWithoutLanguage, otherwise returns back the enum in the Err case of the result

source

pub fn is_name_without_language(&self) -> bool

Returns true if this is a IppValue::NameWithoutLanguage, otherwise false

source

pub fn as_name_without_language_mut(&mut self) -> Option<&mut String>

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

source

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

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

source

pub fn into_name_without_language(self) -> Result<String, Self>

Returns the inner fields if this is a IppValue::NameWithoutLanguage, otherwise returns back the enum in the Err case of the result

source

pub fn is_text_with_language(&self) -> bool

Returns true if this is a IppValue::TextWithLanguage, otherwise false

source

pub fn as_text_with_language_mut( &mut self ) -> Option<(&mut String, &mut String)>

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

source

pub fn as_text_with_language(&self) -> Option<(&String, &String)>

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

source

pub fn into_text_with_language(self) -> Result<(String, String), Self>

Returns the inner fields if this is a IppValue::TextWithLanguage, otherwise returns back the enum in the Err case of the result

source

pub fn is_name_with_language(&self) -> bool

Returns true if this is a IppValue::NameWithLanguage, otherwise false

source

pub fn as_name_with_language_mut( &mut self ) -> Option<(&mut String, &mut String)>

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

source

pub fn as_name_with_language(&self) -> Option<(&String, &String)>

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

source

pub fn into_name_with_language(self) -> Result<(String, String), Self>

Returns the inner fields if this is a IppValue::NameWithLanguage, otherwise returns back the enum in the Err case of the result

source

pub fn is_charset(&self) -> bool

Returns true if this is a IppValue::Charset, otherwise false

source

pub fn as_charset_mut(&mut self) -> Option<&mut String>

Optionally returns mutable references to the inner fields if this is a IppValue::Charset, 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 into_charset(self) -> Result<String, Self>

Returns the inner fields if this is a IppValue::Charset, otherwise returns back the enum in the Err case of the result

source

pub fn is_natural_language(&self) -> bool

Returns true if this is a IppValue::NaturalLanguage, otherwise false

source

pub fn as_natural_language_mut(&mut self) -> Option<&mut String>

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

source

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

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

source

pub fn into_natural_language(self) -> Result<String, Self>

Returns the inner fields if this is a IppValue::NaturalLanguage, otherwise returns back the enum in the Err case of the result

source

pub fn is_uri(&self) -> bool

Returns true if this is a IppValue::Uri, otherwise false

source

pub fn as_uri_mut(&mut self) -> Option<&mut String>

Optionally returns mutable references to the inner fields if this is a IppValue::Uri, 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 into_uri(self) -> Result<String, Self>

Returns the inner fields if this is a IppValue::Uri, otherwise returns back the enum in the Err case of the result

source

pub fn is_uri_scheme(&self) -> bool

Returns true if this is a IppValue::UriScheme, otherwise false

source

pub fn as_uri_scheme_mut(&mut self) -> Option<&mut String>

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

source

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

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

source

pub fn into_uri_scheme(self) -> Result<String, Self>

Returns the inner fields if this is a IppValue::UriScheme, otherwise returns back the enum in the Err case of the result

source

pub fn is_range_of_integer(&self) -> bool

Returns true if this is a IppValue::RangeOfInteger, otherwise false

source

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

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

source

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

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

source

pub fn into_range_of_integer(self) -> Result<(i32, i32), Self>

Returns the inner fields if this is a IppValue::RangeOfInteger, otherwise returns back the enum in the Err case of the result

source

pub fn is_boolean(&self) -> bool

Returns true if this is a IppValue::Boolean, otherwise false

source

pub fn as_boolean_mut(&mut self) -> Option<&mut bool>

Optionally returns mutable references to the inner fields if this is a IppValue::Boolean, 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 into_boolean(self) -> Result<bool, Self>

Returns the inner fields if this is a IppValue::Boolean, otherwise returns back the enum in the Err case of the result

source

pub fn is_keyword(&self) -> bool

Returns true if this is a IppValue::Keyword, otherwise false

source

pub fn as_keyword_mut(&mut self) -> Option<&mut String>

Optionally returns mutable references to the inner fields if this is a IppValue::Keyword, 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 into_keyword(self) -> Result<String, Self>

Returns the inner fields if this is a IppValue::Keyword, otherwise returns back the enum in the Err case of the result

source

pub fn is_array(&self) -> bool

Returns true if this is a IppValue::Array, otherwise false

source

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

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

source

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

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

source

pub fn into_array(self) -> Result<Vec<IppValue>, Self>

Returns the inner fields if this is a IppValue::Array, otherwise returns back the enum in the Err case of the result

source

pub fn is_collection(&self) -> bool

Returns true if this is a IppValue::Collection, otherwise false

source

pub fn as_collection_mut(&mut self) -> Option<&mut BTreeMap<String, IppValue>>

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

source

pub fn as_collection(&self) -> Option<&BTreeMap<String, IppValue>>

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

source

pub fn into_collection(self) -> Result<BTreeMap<String, IppValue>, Self>

Returns the inner fields if this is a IppValue::Collection, otherwise returns back the enum in the Err case of the result

source

pub fn is_mime_media_type(&self) -> bool

Returns true if this is a IppValue::MimeMediaType, otherwise false

source

pub fn as_mime_media_type_mut(&mut self) -> Option<&mut String>

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

source

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

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

source

pub fn into_mime_media_type(self) -> Result<String, Self>

Returns the inner fields if this is a IppValue::MimeMediaType, otherwise returns back the enum in the Err case of the result

source

pub fn is_date_time(&self) -> bool

Returns true if this is a IppValue::DateTime, otherwise false

source

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

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

source

pub fn as_date_time( &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 into_date_time( self ) -> Result<(u16, u8, u8, u8, u8, u8, u8, char, u8, u8), Self>

Returns the inner fields if this is a IppValue::DateTime, otherwise returns back the enum in the Err case of the result

source

pub fn is_member_attr_name(&self) -> bool

Returns true if this is a IppValue::MemberAttrName, otherwise false

source

pub fn as_member_attr_name_mut(&mut self) -> Option<&mut String>

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

source

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

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

source

pub fn into_member_attr_name(self) -> Result<String, Self>

Returns the inner fields if this is a IppValue::MemberAttrName, otherwise returns back the enum in the Err case of the result

source

pub fn is_resolution(&self) -> bool

Returns true if this is a IppValue::Resolution, otherwise false

source

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

Optionally returns mutable references to the inner fields if this is a IppValue::Resolution, 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 into_resolution(self) -> Result<(i32, i32, i8), Self>

Returns the inner fields if this is a IppValue::Resolution, otherwise returns back the enum in the Err case of the result

source

pub fn is_no_value(&self) -> bool

Returns true if this is a IppValue::NoValue, otherwise false

source

pub fn is_other(&self) -> bool

Returns true if this is a IppValue::Other, otherwise false

source

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

Optionally returns mutable references to the inner fields if this is a IppValue::Other, 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

pub fn into_other(self) -> Result<(u8, Bytes), Self>

Returns the inner fields if this is a IppValue::Other, otherwise returns back the enum in the Err case of the result

source§

impl IppValue

source

pub fn to_tag(&self) -> u8

Convert to binary tag

source

pub fn parse(value_tag: u8, data: Bytes) -> Result<IppValue>

Parse value from byte array which does not include the value length field

source

pub fn to_bytes(&self) -> Bytes

Write value to byte array, including leading value length field, excluding value tag

Trait Implementations§

source§

impl Clone for IppValue

source§

fn clone(&self) -> IppValue

Returns a copy 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 FromStr for IppValue

§

type Err = Infallible

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
source§

impl Hash for IppValue

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<'a> IntoIterator for &'a IppValue

§

type Item = &'a IppValue

The type of the elements being iterated over.
§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for IppValue

source§

impl StructuralEq for IppValue

source§

impl StructuralPartialEq for IppValue

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere 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 Twhere T: Clone,

§

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 Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more