pub struct OptionNumber(pub u16);Expand description
Type representing a CoAP option number.
Tuple Fields§
§0: u16Implementations§
Source§impl OptionNumber
impl OptionNumber
Sourcepub const IF_MATCH: OptionNumber
pub const IF_MATCH: OptionNumber
IF_MATCH option.
Sourcepub const URI_HOST: OptionNumber
pub const URI_HOST: OptionNumber
URI_HOST option.
Sourcepub const ETAG: OptionNumber
pub const ETAG: OptionNumber
ETAG option.
Sourcepub const IF_NONE_MATCH: OptionNumber
pub const IF_NONE_MATCH: OptionNumber
IF_NONE_MATCH option.
Sourcepub const OBSERVE: OptionNumber
pub const OBSERVE: OptionNumber
OBSERVE option.
Sourcepub const URI_PORT: OptionNumber
pub const URI_PORT: OptionNumber
URI_PORT option.
Sourcepub const LOCATION_PATH: OptionNumber
pub const LOCATION_PATH: OptionNumber
LOCATION_PATH option.
Sourcepub const OSCORE: OptionNumber
pub const OSCORE: OptionNumber
OSCORE option.
Sourcepub const URI_PATH: OptionNumber
pub const URI_PATH: OptionNumber
URI_PATH option.
Sourcepub const CONTENT_FORMAT: OptionNumber
pub const CONTENT_FORMAT: OptionNumber
CONTENT_FORMAT option.
Sourcepub const MAX_AGE: OptionNumber
pub const MAX_AGE: OptionNumber
MAX_AGE option.
Sourcepub const URI_QUERY: OptionNumber
pub const URI_QUERY: OptionNumber
URI_QUERY option.
Sourcepub const ACCEPT: OptionNumber
pub const ACCEPT: OptionNumber
ACCEPT option.
Sourcepub const LOCATION_QUERY: OptionNumber
pub const LOCATION_QUERY: OptionNumber
LOCATION_QUERY option.
Sourcepub const BLOCK2: OptionNumber
pub const BLOCK2: OptionNumber
BLOCK2 option.
Sourcepub const BLOCK1: OptionNumber
pub const BLOCK1: OptionNumber
BLOCK1 option.
Sourcepub const SIZE2: OptionNumber
pub const SIZE2: OptionNumber
SIZE2 option.
Sourcepub const PROXY_URI: OptionNumber
pub const PROXY_URI: OptionNumber
PROXY_URI option.
Sourcepub const PROXY_SCHEME: OptionNumber
pub const PROXY_SCHEME: OptionNumber
PROXY_SCHEME option.
Sourcepub const SIZE1: OptionNumber
pub const SIZE1: OptionNumber
SIZE1 option.
Sourcepub const NO_RESPONSE: OptionNumber
pub const NO_RESPONSE: OptionNumber
NO_RESPONSE option.
Sourcepub fn is_critical(self) -> bool
pub fn is_critical(self) -> bool
Returns true if this option number is critical, false if it is optional.
Sourcepub fn is_un_safe(self) -> bool
pub fn is_un_safe(self) -> bool
Returns true if this option is “un-safe”.
Sourcepub fn is_no_cache_key(self) -> bool
pub fn is_no_cache_key(self) -> bool
Returns true if this option is a “no-cache-key” option.
Sourcepub fn option_value_type(self) -> OptionValueType
pub fn option_value_type(self) -> OptionValueType
Returns the expected value type for this option number.
Sourcepub fn is_ok_in_request(self) -> bool
pub fn is_ok_in_request(self) -> bool
Returns true if this option is allowed in requests, false if it is prohibited in requests.
Sourcepub fn is_ok_in_response(self) -> bool
pub fn is_ok_in_response(self) -> bool
Returns true if this option is allowed in responses, false if it is prohibited in responses.
Sourcepub fn is_repeatable(self) -> bool
pub fn is_repeatable(self) -> bool
Returns true if multiple instances of this option are allowed, false if only one instance is allowed.
Sourcepub fn static_name(self) -> Option<&'static str>
pub fn static_name(self) -> Option<&'static str>
Attempts to return a Some(&'static str) containing the name of the option.
If the option number isn’t recognized, this method returns None.
Sourcepub fn fmt_with_value(self, f: &mut Formatter<'_>, value: &[u8]) -> Result
pub fn fmt_with_value(self, f: &mut Formatter<'_>, value: &[u8]) -> Result
Writes out the name of this option along with a text debugging description of the value associated with this option.
Trait Implementations§
Source§impl Add<u16> for OptionNumber
impl Add<u16> for OptionNumber
Source§impl Clone for OptionNumber
impl Clone for OptionNumber
Source§fn clone(&self) -> OptionNumber
fn clone(&self) -> OptionNumber
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for OptionNumber
Source§impl Debug for OptionNumber
impl Debug for OptionNumber
Source§impl Default for OptionNumber
impl Default for OptionNumber
Source§impl Display for OptionNumber
impl Display for OptionNumber
impl Eq for OptionNumber
Source§impl Hash for OptionNumber
impl Hash for OptionNumber
Source§impl Ord for OptionNumber
impl Ord for OptionNumber
Source§fn cmp(&self, other: &OptionNumber) -> Ordering
fn cmp(&self, other: &OptionNumber) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for OptionNumber
impl PartialEq for OptionNumber
Source§fn eq(&self, other: &OptionNumber) -> bool
fn eq(&self, other: &OptionNumber) -> bool
self and other values to be equal, and is used by ==.