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
NameWithLanguage
Charset(String)
NaturalLanguage(String)
Uri(String)
UriScheme(String)
RangeOfInteger
Boolean(bool)
Keyword(String)
Array(Vec<IppValue>)
Collection(BTreeMap<String, IppValue>)
MimeMediaType(String)
DateTime
Fields
MemberAttrName(String)
Resolution
NoValue
Other
Implementations§
source§impl IppValue
impl IppValue
sourcepub fn is_integer(&self) -> bool
pub fn is_integer(&self) -> bool
Returns true if this is a IppValue::Integer
, otherwise false
sourcepub fn as_integer_mut(&mut self) -> Option<&mut i32>
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
sourcepub fn as_integer(&self) -> Option<&i32>
pub fn as_integer(&self) -> Option<&i32>
Optionally returns references to the inner fields if this is a IppValue::Integer
, otherwise None
sourcepub fn into_integer(self) -> Result<i32, Self>
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
sourcepub fn as_enum_mut(&mut self) -> Option<&mut i32>
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
sourcepub fn as_enum(&self) -> Option<&i32>
pub fn as_enum(&self) -> Option<&i32>
Optionally returns references to the inner fields if this is a IppValue::Enum
, otherwise None
sourcepub fn into_enum(self) -> Result<i32, Self>
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
sourcepub fn is_octet_string(&self) -> bool
pub fn is_octet_string(&self) -> bool
Returns true if this is a IppValue::OctetString
, otherwise false
sourcepub fn as_octet_string_mut(&mut self) -> Option<&mut String>
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
sourcepub fn as_octet_string(&self) -> Option<&String>
pub fn as_octet_string(&self) -> Option<&String>
Optionally returns references to the inner fields if this is a IppValue::OctetString
, otherwise None
sourcepub fn into_octet_string(self) -> Result<String, Self>
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
sourcepub fn is_text_without_language(&self) -> bool
pub fn is_text_without_language(&self) -> bool
Returns true if this is a IppValue::TextWithoutLanguage
, otherwise false
sourcepub fn as_text_without_language_mut(&mut self) -> Option<&mut String>
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
sourcepub fn as_text_without_language(&self) -> Option<&String>
pub fn as_text_without_language(&self) -> Option<&String>
Optionally returns references to the inner fields if this is a IppValue::TextWithoutLanguage
, otherwise None
sourcepub fn into_text_without_language(self) -> Result<String, Self>
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
sourcepub fn is_name_without_language(&self) -> bool
pub fn is_name_without_language(&self) -> bool
Returns true if this is a IppValue::NameWithoutLanguage
, otherwise false
sourcepub fn as_name_without_language_mut(&mut self) -> Option<&mut String>
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
sourcepub fn as_name_without_language(&self) -> Option<&String>
pub fn as_name_without_language(&self) -> Option<&String>
Optionally returns references to the inner fields if this is a IppValue::NameWithoutLanguage
, otherwise None
sourcepub fn into_name_without_language(self) -> Result<String, Self>
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
sourcepub fn is_text_with_language(&self) -> bool
pub fn is_text_with_language(&self) -> bool
Returns true if this is a IppValue::TextWithLanguage
, otherwise false
sourcepub fn as_text_with_language_mut(
&mut self
) -> Option<(&mut String, &mut String)>
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
sourcepub fn as_text_with_language(&self) -> Option<(&String, &String)>
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
sourcepub fn into_text_with_language(self) -> Result<(String, String), Self>
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
sourcepub fn is_name_with_language(&self) -> bool
pub fn is_name_with_language(&self) -> bool
Returns true if this is a IppValue::NameWithLanguage
, otherwise false
sourcepub fn as_name_with_language_mut(
&mut self
) -> Option<(&mut String, &mut String)>
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
sourcepub fn as_name_with_language(&self) -> Option<(&String, &String)>
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
sourcepub fn into_name_with_language(self) -> Result<(String, String), Self>
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
sourcepub fn is_charset(&self) -> bool
pub fn is_charset(&self) -> bool
Returns true if this is a IppValue::Charset
, otherwise false
sourcepub fn as_charset_mut(&mut self) -> Option<&mut String>
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
sourcepub fn as_charset(&self) -> Option<&String>
pub fn as_charset(&self) -> Option<&String>
Optionally returns references to the inner fields if this is a IppValue::Charset
, otherwise None
sourcepub fn into_charset(self) -> Result<String, Self>
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
sourcepub fn is_natural_language(&self) -> bool
pub fn is_natural_language(&self) -> bool
Returns true if this is a IppValue::NaturalLanguage
, otherwise false
sourcepub fn as_natural_language_mut(&mut self) -> Option<&mut String>
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
sourcepub fn as_natural_language(&self) -> Option<&String>
pub fn as_natural_language(&self) -> Option<&String>
Optionally returns references to the inner fields if this is a IppValue::NaturalLanguage
, otherwise None
sourcepub fn into_natural_language(self) -> Result<String, Self>
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
sourcepub fn as_uri_mut(&mut self) -> Option<&mut String>
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
sourcepub fn as_uri(&self) -> Option<&String>
pub fn as_uri(&self) -> Option<&String>
Optionally returns references to the inner fields if this is a IppValue::Uri
, otherwise None
sourcepub fn into_uri(self) -> Result<String, Self>
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
sourcepub fn is_uri_scheme(&self) -> bool
pub fn is_uri_scheme(&self) -> bool
Returns true if this is a IppValue::UriScheme
, otherwise false
sourcepub fn as_uri_scheme_mut(&mut self) -> Option<&mut String>
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
sourcepub fn as_uri_scheme(&self) -> Option<&String>
pub fn as_uri_scheme(&self) -> Option<&String>
Optionally returns references to the inner fields if this is a IppValue::UriScheme
, otherwise None
sourcepub fn into_uri_scheme(self) -> Result<String, Self>
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
sourcepub fn is_range_of_integer(&self) -> bool
pub fn is_range_of_integer(&self) -> bool
Returns true if this is a IppValue::RangeOfInteger
, otherwise false
sourcepub fn as_range_of_integer_mut(&mut self) -> Option<(&mut i32, &mut i32)>
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
sourcepub fn as_range_of_integer(&self) -> Option<(&i32, &i32)>
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
sourcepub fn into_range_of_integer(self) -> Result<(i32, i32), Self>
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
sourcepub fn is_boolean(&self) -> bool
pub fn is_boolean(&self) -> bool
Returns true if this is a IppValue::Boolean
, otherwise false
sourcepub fn as_boolean_mut(&mut self) -> Option<&mut bool>
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
sourcepub fn as_boolean(&self) -> Option<&bool>
pub fn as_boolean(&self) -> Option<&bool>
Optionally returns references to the inner fields if this is a IppValue::Boolean
, otherwise None
sourcepub fn into_boolean(self) -> Result<bool, Self>
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
sourcepub fn is_keyword(&self) -> bool
pub fn is_keyword(&self) -> bool
Returns true if this is a IppValue::Keyword
, otherwise false
sourcepub fn as_keyword_mut(&mut self) -> Option<&mut String>
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
sourcepub fn as_keyword(&self) -> Option<&String>
pub fn as_keyword(&self) -> Option<&String>
Optionally returns references to the inner fields if this is a IppValue::Keyword
, otherwise None
sourcepub fn into_keyword(self) -> Result<String, Self>
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
sourcepub fn as_array_mut(&mut self) -> Option<&mut Vec<IppValue>>
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
sourcepub fn as_array(&self) -> Option<&Vec<IppValue>>
pub fn as_array(&self) -> Option<&Vec<IppValue>>
Optionally returns references to the inner fields if this is a IppValue::Array
, otherwise None
sourcepub fn into_array(self) -> Result<Vec<IppValue>, Self>
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
sourcepub fn is_collection(&self) -> bool
pub fn is_collection(&self) -> bool
Returns true if this is a IppValue::Collection
, otherwise false
sourcepub fn as_collection_mut(&mut self) -> Option<&mut BTreeMap<String, IppValue>>
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
sourcepub fn as_collection(&self) -> Option<&BTreeMap<String, IppValue>>
pub fn as_collection(&self) -> Option<&BTreeMap<String, IppValue>>
Optionally returns references to the inner fields if this is a IppValue::Collection
, otherwise None
sourcepub fn into_collection(self) -> Result<BTreeMap<String, IppValue>, Self>
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
sourcepub fn is_mime_media_type(&self) -> bool
pub fn is_mime_media_type(&self) -> bool
Returns true if this is a IppValue::MimeMediaType
, otherwise false
sourcepub fn as_mime_media_type_mut(&mut self) -> Option<&mut String>
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
sourcepub fn as_mime_media_type(&self) -> Option<&String>
pub fn as_mime_media_type(&self) -> Option<&String>
Optionally returns references to the inner fields if this is a IppValue::MimeMediaType
, otherwise None
sourcepub fn into_mime_media_type(self) -> Result<String, Self>
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
sourcepub fn is_date_time(&self) -> bool
pub fn is_date_time(&self) -> bool
Returns true if this is a IppValue::DateTime
, otherwise false
sourcepub 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)>
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
sourcepub fn as_date_time(
&self
) -> Option<(&u16, &u8, &u8, &u8, &u8, &u8, &u8, &char, &u8, &u8)>
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
sourcepub fn into_date_time(
self
) -> Result<(u16, u8, u8, u8, u8, u8, u8, char, u8, u8), Self>
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
sourcepub fn is_member_attr_name(&self) -> bool
pub fn is_member_attr_name(&self) -> bool
Returns true if this is a IppValue::MemberAttrName
, otherwise false
sourcepub fn as_member_attr_name_mut(&mut self) -> Option<&mut String>
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
sourcepub fn as_member_attr_name(&self) -> Option<&String>
pub fn as_member_attr_name(&self) -> Option<&String>
Optionally returns references to the inner fields if this is a IppValue::MemberAttrName
, otherwise None
sourcepub fn into_member_attr_name(self) -> Result<String, Self>
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
sourcepub fn is_resolution(&self) -> bool
pub fn is_resolution(&self) -> bool
Returns true if this is a IppValue::Resolution
, otherwise false
sourcepub fn as_resolution_mut(&mut self) -> Option<(&mut i32, &mut i32, &mut i8)>
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
sourcepub fn as_resolution(&self) -> Option<(&i32, &i32, &i8)>
pub fn as_resolution(&self) -> Option<(&i32, &i32, &i8)>
Optionally returns references to the inner fields if this is a IppValue::Resolution
, otherwise None
sourcepub fn into_resolution(self) -> Result<(i32, i32, i8), Self>
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
sourcepub fn is_no_value(&self) -> bool
pub fn is_no_value(&self) -> bool
Returns true if this is a IppValue::NoValue
, otherwise false
sourcepub fn as_other_mut(&mut self) -> Option<(&mut u8, &mut Bytes)>
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
sourcepub fn as_other(&self) -> Option<(&u8, &Bytes)>
pub fn as_other(&self) -> Option<(&u8, &Bytes)>
Optionally returns references to the inner fields if this is a IppValue::Other
, otherwise None
sourcepub fn into_other(self) -> Result<(u8, Bytes), Self>
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
Trait Implementations§
source§impl<'a> IntoIterator for &'a IppValue
impl<'a> IntoIterator for &'a IppValue
source§impl PartialEq for IppValue
impl PartialEq for IppValue
impl Eq for IppValue
impl StructuralEq for IppValue
impl StructuralPartialEq for IppValue
Auto Trait Implementations§
impl RefUnwindSafe for IppValue
impl Send for IppValue
impl Sync for IppValue
impl Unpin for IppValue
impl UnwindSafe for IppValue
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
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.