pub trait MessageOptions {
    type OptValues: Array<Item = OptValue<Self::OptValueBytes>>;
    type OptValueBytes: Array<Item = u8> + AppendCopy<u8>;
    type SetError;

Show 53 methods // Required methods fn add( &mut self, n: OptNumber, v: OptValue<Self::OptValueBytes> ) -> Result<(), Self::SetError>; fn set( &mut self, n: OptNumber, v: OptValue<Self::OptValueBytes> ) -> Result<Option<Self::OptValues>, Self::SetError>; fn count(&self, n: OptNumber) -> usize; fn get(&self, n: OptNumber) -> Option<&Self::OptValues>; fn get_first(&self, n: OptNumber) -> Option<&OptValue<Self::OptValueBytes>>; fn get_str(&self, n: OptNumber) -> Result<Option<&str>, Utf8Error>; fn get_strs<'a, F>(&'a self, n: OptNumber) -> Result<F, Utf8Error> where F: FromIterator<&'a str>; fn get_u8(&self, n: OptNumber) -> Option<u8>; fn get_u16(&self, n: OptNumber) -> Option<u16>; fn get_u32(&self, n: OptNumber) -> Option<u32>; fn get_u64(&self, n: OptNumber) -> Option<u64>; fn remove(&mut self, n: OptNumber) -> Option<Self::OptValues>; // Provided methods fn set_host<S>(&mut self, host: S) -> Result<(), Self::SetError> where S: AsRef<str> { ... } fn block1(&self) -> Option<Block> { ... } fn set_block1( &mut self, size: u16, num: u32, more: bool ) -> Result<(), Self::SetError> { ... } fn block2(&self) -> Option<Block> { ... } fn set_block2( &mut self, size: u16, num: u32, more: bool ) -> Result<(), Self::SetError> { ... } fn host(&self) -> Result<Option<&str>, Utf8Error> { ... } fn set_port(&mut self, port: u16) -> Result<(), Self::SetError> { ... } fn port(&self) -> Option<u16> { ... } fn set_path<S>(&mut self, path: S) -> Result<(), Self::SetError> where S: AsRef<str> { ... } fn path<'a, F>(&'a self) -> Result<F, Utf8Error> where F: FromIterator<&'a str> { ... } fn path_string<'a>(&'a self) -> Result<String, Utf8Error> { ... } fn add_query<S>(&mut self, query: S) -> Result<(), Self::SetError> where S: AsRef<str> { ... } fn query<'a, F>(&'a self) -> Result<F, Utf8Error> where F: FromIterator<&'a str> { ... } fn set_content_format( &mut self, format: ContentFormat ) -> Result<(), Self::SetError> { ... } fn content_format(&self) -> Option<ContentFormat> { ... } fn set_observe(&mut self, a: Action) -> Result<(), Self::SetError> { ... } fn observe(&self) -> Option<Action> { ... } fn set_accept( &mut self, format: ContentFormat ) -> Result<(), Self::SetError> { ... } fn accept(&self) -> Option<ContentFormat> { ... } fn set_size1(&mut self, size_bytes: u64) -> Result<(), Self::SetError> { ... } fn size1(&self) -> Option<u64> { ... } fn set_size2(&mut self, size_bytes: u64) -> Result<(), Self::SetError> { ... } fn size2(&self) -> Option<u64> { ... } fn set_if_exists(&mut self) -> Result<(), Self::SetError> { ... } fn if_exists_flag_enabled(&self) -> bool { ... } fn set_if_not_exists(&mut self) -> Result<(), Self::SetError> { ... } fn if_not_exists_flag_enabled(&self) -> bool { ... } fn set_max_age( &mut self, max_age_seconds: u32 ) -> Result<(), Self::SetError> { ... } fn max_age_seconds(&self) -> Option<u32> { ... } fn set_proxy_uri<S>(&mut self, uri: S) -> Result<(), Self::SetError> where S: AsRef<str> { ... } fn proxy_uri(&self) -> Result<Option<&str>, Utf8Error> { ... } fn set_proxy_scheme<S>(&mut self, scheme: S) -> Result<(), Self::SetError> where S: AsRef<str> { ... } fn proxy_scheme(&self) -> Result<Option<&str>, Utf8Error> { ... } fn add_if_match<B>(&mut self, tag: B) -> Result<(), Self::SetError> where B: AsRef<[u8]> { ... } fn if_match(&self) -> Option<&Self::OptValues> { ... } fn add_location_path<S>(&mut self, path: S) -> Result<(), Self::SetError> where S: AsRef<str> { ... } fn location_path<'a, F>(&'a self) -> Result<F, Utf8Error> where F: FromIterator<&'a str> { ... } fn add_location_query<S>(&mut self, query: S) -> Result<(), Self::SetError> where S: AsRef<str> { ... } fn location_query<'a, F>(&'a self) -> Result<F, Utf8Error> where F: FromIterator<&'a str> { ... } fn add_etag<B>(&mut self, tag: B) -> Result<(), Self::SetError> where B: AsRef<[u8]> { ... } fn etags(&self) -> Option<&Self::OptValues> { ... }
}
Expand description

Methods that allow accessing & setting options known to the toad library.

Required Associated Types§

Required Methods§

source

fn add( &mut self, n: OptNumber, v: OptValue<Self::OptValueBytes> ) -> Result<(), Self::SetError>

Insert a new value for a given option

Errors when there cannot be any more options, or the option cannot be repeated any more (only applies to non-std environments)

Repeatable Options

generated from RFC7252 section 5.4.5

The definition of some options specifies that those options are repeatable. An option that is repeatable MAY be included one or more times in a message. An option that is not repeatable MUST NOT be included more than once in a message.

If a message includes an option with more occurrences than the option is defined for, each supernumerary option occurrence that appears subsequently in the message MUST be treated like an unrecognized option (see Section 5.4.1).

source

fn set( &mut self, n: OptNumber, v: OptValue<Self::OptValueBytes> ) -> Result<Option<Self::OptValues>, Self::SetError>

Replace any / all existing values with a new one, yielding the previous value(s)

source

fn count(&self, n: OptNumber) -> usize

Get the number of values for a given option

source

fn get(&self, n: OptNumber) -> Option<&Self::OptValues>

Get the value(s) of an option by number

This just invokes [toad_common::Map::get] on [Message.opts].

source

fn get_first(&self, n: OptNumber) -> Option<&OptValue<Self::OptValueBytes>>

Get the value of an option, taking the first if there are multiple.

source

fn get_str(&self, n: OptNumber) -> Result<Option<&str>, Utf8Error>

Get the value of an option, and interpret it as a UTF-8 string

source

fn get_strs<'a, F>(&'a self, n: OptNumber) -> Result<F, Utf8Error>where F: FromIterator<&'a str>,

Get all values for an option, and interpret them as UTF-8 strings

source

fn get_u8(&self, n: OptNumber) -> Option<u8>

Get the value of an option, and interpret it as a u8

source

fn get_u16(&self, n: OptNumber) -> Option<u16>

Get the value of an option, and interpret it as a u16

source

fn get_u32(&self, n: OptNumber) -> Option<u32>

Get the value of an option, and interpret it as a u32

source

fn get_u64(&self, n: OptNumber) -> Option<u64>

Get the value of an option, and interpret it as a u64

source

fn remove(&mut self, n: OptNumber) -> Option<Self::OptValues>

Remove all values for the option from this message, returning them if there were any.

Provided Methods§

source

fn set_host<S>(&mut self, host: S) -> Result<(), Self::SetError>where S: AsRef<str>,

Update the value for the Uri-Host option, discarding any existing values.

use toad_msg::alloc::Message;
use toad_msg::{Code, Id, MessageOptions, Token, Type};

let mut msg = Message::new(Type::Con, Code::GET, Id(1), Token(Default::default()));

msg.set_host("cheese.com").unwrap();
assert_eq!(msg.host(), Ok(Some("cheese.com")));
Uri-Host, Uri-Port, Uri-Path, and Uri-Query

generated from RFC7252 section 5.10.1

The Uri-Host, Uri-Port, Uri-Path, and Uri-Query Options are used to specify the target resource of a request to a CoAP origin server. The options encode the different components of the request URI in a way that no percent-encoding is visible in the option values and that the full URI can be reconstructed at any involved endpoint. The syntax of CoAP URIs is defined in Section 6.

The steps for parsing URIs into options is defined in Section 6.4. These steps result in zero or more Uri-Host, Uri-Port, Uri-Path, and Uri-Query Options being included in a request, where each option holds the following values:

o the Uri-Host Option specifies the Internet host of the resource being requested,

o the Uri-Port Option specifies the transport-layer port number of the resource,

o each Uri-Path Option specifies one segment of the absolute path to the resource, and

o each Uri-Query Option specifies one argument parameterizing the resource.

Note: Fragments ([RFC3986], Section 3.5) are not part of the request URI and thus will not be transmitted in a CoAP request.

The default value of the Uri-Host Option is the IP literal representing the destination IP address of the request message. Likewise, the default value of the Uri-Port Option is the destination UDP port. The default values for the Uri-Host and Uri-Port Options are sufficient for requests to most servers. Explicit Uri-Host and Uri-Port Options are typically used when an endpoint hosts multiple virtual servers.

The Uri-Path and Uri-Query Option can contain any character sequence. No percent-encoding is performed. The value of a Uri-Path Option MUST NOT be “.” or “..” (as the request URI must be resolved before parsing it into options).

The steps for constructing the request URI from the options are defined in Section 6.5. Note that an implementation does not necessarily have to construct the URI; it can simply look up the target resource by examining the individual options.

Examples can be found in Appendix B.

source

fn block1(&self) -> Option<Block>

source

fn set_block1( &mut self, size: u16, num: u32, more: bool ) -> Result<(), Self::SetError>

source

fn block2(&self) -> Option<Block>

source

fn set_block2( &mut self, size: u16, num: u32, more: bool ) -> Result<(), Self::SetError>

source

fn host(&self) -> Result<Option<&str>, Utf8Error>

Get the value for the Uri-Host option

source

fn set_port(&mut self, port: u16) -> Result<(), Self::SetError>

Update the value for the Uri-Port option, discarding any existing values.

use toad_msg::alloc::Message;
use toad_msg::{Code, Id, MessageOptions, Token, Type};

let mut msg = Message::new(Type::Con, Code::GET, Id(1), Token(Default::default()));

msg.set_host("cheese.com").unwrap();
msg.set_port(1234).unwrap();
assert_eq!(msg.host(), Ok(Some("cheese.com")));
assert_eq!(msg.port(), Some(1234));
source

fn port(&self) -> Option<u16>

Get the value for the Uri-Port option

source

fn set_path<S>(&mut self, path: S) -> Result<(), Self::SetError>where S: AsRef<str>,

Update the value for the Uri-Path option, discarding any existing values.

use toad_msg::alloc::Message;
use toad_msg::{Code, Id, MessageOptions, Token, Type};

let mut msg = Message::new(Type::Con, Code::GET, Id(1), Token(Default::default()));

msg.set_host("cheese.com").unwrap();
msg.set_port(1234).unwrap();
msg.set_path("cheese/havarti/suggestions").unwrap();
assert_eq!(msg.host(), Ok(Some("cheese.com")));
assert_eq!(msg.port(), Some(1234));
assert_eq!(msg.path_string(),
           Ok("cheese/havarti/suggestions".to_string()));
source

fn path<'a, F>(&'a self) -> Result<F, Utf8Error>where F: FromIterator<&'a str>,

Get an iterator over the Uri-Path segments

source

fn path_string<'a>(&'a self) -> Result<String, Utf8Error>

Get the fully built path, joining segments with ‘/’.

source

fn add_query<S>(&mut self, query: S) -> Result<(), Self::SetError>where S: AsRef<str>,

Insert a new value for the Uri-Query option, alongside any existing values.

source

fn query<'a, F>(&'a self) -> Result<F, Utf8Error>where F: FromIterator<&'a str>,

Get all query parameters for this request

use toad_msg::alloc::Message;
use toad_msg::{Code, Id, MessageOptions, Token, Type};

let mut msg = Message::new(Type::Con, Code::GET, Id(1), Token(Default::default()));

msg.add_query("id[eq]=123").unwrap();
msg.add_query("price[lt]=333").unwrap();
assert_eq!(msg.query::<Vec<_>>(),
           Ok(vec!["id[eq]=123", "price[lt]=333"]));
source

fn set_content_format( &mut self, format: ContentFormat ) -> Result<(), Self::SetError>

Update the value for the Content-Format option, discarding any existing values.

Content-Format

generated from RFC7252 section 5.10.3

The Content-Format Option indicates the representation format of the message payload. The representation format is given as a numeric Content-Format identifier that is defined in the “CoAP Content- Formats” registry (Section 12.3). In the absence of the option, no default value is assumed, i.e., the representation format of any representation message payload is indeterminate (Section 5.5).

source

fn content_format(&self) -> Option<ContentFormat>

Get the value for the Content-Format option

use toad_msg::alloc::Message;
use toad_msg::ContentFormat::Json;
use toad_msg::{Code, Id, MessageOptions, Token, Type};

let mut msg = Message::new(Type::Con, Code::GET, Id(1), Token(Default::default()));

msg.set_content_format(Json).unwrap();
assert_eq!(msg.content_format(), Some(Json));
source

fn set_observe(&mut self, a: Action) -> Result<(), Self::SetError>

Set the value for the Observe option, discarding any existing values.

source

fn observe(&self) -> Option<Action>

Get the value for the Observe option

source

fn set_accept(&mut self, format: ContentFormat) -> Result<(), Self::SetError>

Update the value for the Accept option, discarding any existing values.

Accept

generated from RFC7252 section 5.10.4

The CoAP Accept option can be used to indicate which Content-Format is acceptable to the client. The representation format is given as a numeric Content-Format identifier that is defined in the “CoAP Content-Formats” registry (Section 12.3). If no Accept option is given, the client does not express a preference (thus no default value is assumed). The client prefers the representation returned by the server to be in the Content-Format indicated. The server returns the preferred Content-Format if available. If the preferred Content- Format cannot be returned, then a 4.06 “Not Acceptable” MUST be sent as a response, unless another error code takes precedence for this response.

source

fn accept(&self) -> Option<ContentFormat>

Get the value for the Accept option

source

fn set_size1(&mut self, size_bytes: u64) -> Result<(), Self::SetError>

Update the value for the Size1 option, discarding any existing values.

Size1 Option

generated from RFC7252 section 5.10.9

The Size1 option provides size information about the resource representation in a request. The option value is an integer number of bytes. Its main use is with block-wise transfers [BLOCK]. In the present specification, it is used in 4.13 responses (Section 5.9.2.9) to indicate the maximum size of request entity that the server is able and willing to handle.

source

fn size1(&self) -> Option<u64>

Get the value for the Size1 option

source

fn set_size2(&mut self, size_bytes: u64) -> Result<(), Self::SetError>

Update the value for the Size2 option, discarding any existing values.

source

fn size2(&self) -> Option<u64>

Get the value for the Size2 option

source

fn set_if_exists(&mut self) -> Result<(), Self::SetError>

Discard all values for If-Match, and replace them with an empty value.

This signals that our request should only be processed if we’re trying to update a resource that exists (e.g. this ensures PUT only updates and will never insert)

If-Match

generated from RFC7252 section 5.10.8.1

The If-Match Option MAY be used to make a request conditional on the current existence or value of an ETag for one or more representations of the target resource. If-Match is generally useful for resource update requests, such as PUT requests, as a means for protecting against accidental overwrites when multiple clients are acting in parallel on the same resource (i.e., the “lost update” problem).

The value of an If-Match option is either an ETag or the empty string. An If-Match option with an ETag matches a representation with that exact ETag. An If-Match option with an empty value matches any existing representation (i.e., it places the precondition on the existence of any current representation for the target resource).

The If-Match Option can occur multiple times. If any of the options match, then the condition is fulfilled.

If there is one or more If-Match Options, but none of the options match, then the condition is not fulfilled.

source

fn if_exists_flag_enabled(&self) -> bool

Get whether or not Message::set_if_exists applies

source

fn set_if_not_exists(&mut self) -> Result<(), Self::SetError>

Enable the If-None-Match flag

This signals that our request should only be processed if we’re trying to insert a resource that does not exist (e.g. this ensures PUT only inserts and will never update)

If-None-Match

generated from RFC7252 section 5.10.8.2

The If-None-Match Option MAY be used to make a request conditional on the nonexistence of the target resource. If-None-Match is useful for resource creation requests, such as PUT requests, as a means for protecting against accidental overwrites when multiple clients are acting in parallel on the same resource. The If-None-Match Option carries no value.

If the target resource does exist, then the condition is not fulfilled.

(It is not very useful to combine If-Match and If-None-Match options in one request, because the condition will then never be fulfilled.)

source

fn if_not_exists_flag_enabled(&self) -> bool

Get whether or not Message::set_if_not_exists applies

source

fn set_max_age(&mut self, max_age_seconds: u32) -> Result<(), Self::SetError>

Update the value for the Max-Age option, discarding any existing values.

Max-Age

generated from RFC7252 section 5.10.5

The Max-Age Option indicates the maximum time a response may be cached before it is considered not fresh (see Section 5.6.1).

The option value is an integer number of seconds between 0 and 2**32-1 inclusive (about 136.1 years). A default value of 60 seconds is assumed in the absence of the option in a response.

The value is intended to be current at the time of transmission. Servers that provide resources with strict tolerances on the value of Max-Age SHOULD update the value before each retransmission. (See also Section 5.7.1.)

source

fn max_age_seconds(&self) -> Option<u32>

Get the value for the Max-Age option, in seconds

source

fn set_proxy_uri<S>(&mut self, uri: S) -> Result<(), Self::SetError>where S: AsRef<str>,

Update the value for the Proxy-Uri option, discarding any existing values.

Proxy-Uri and Proxy-Scheme

generated from RFC7252 section 5.10.2

The Proxy-Uri Option is used to make a request to a forward-proxy (see Section 5.7). The forward-proxy is requested to forward the request or service it from a valid cache and return the response.

The option value is an absolute-URI ([RFC3986], Section 4.3).

Note that the forward-proxy MAY forward the request on to another proxy or directly to the server specified by the absolute-URI. In order to avoid request loops, a proxy MUST be able to recognize all of its server names, including any aliases, local variations, and the numeric IP addresses.

An endpoint receiving a request with a Proxy-Uri Option that is unable or unwilling to act as a forward-proxy for the request MUST cause the return of a 5.05 (Proxying Not Supported) response.

The Proxy-Uri Option MUST take precedence over any of the Uri-Host, Uri-Port, Uri-Path or Uri-Query options (each of which MUST NOT be included in a request containing the Proxy-Uri Option).

As a special case to simplify many proxy clients, the absolute-URI can be constructed from the Uri-* options. When a Proxy-Scheme Option is present, the absolute-URI is constructed as follows: a CoAP URI is constructed from the Uri-* options as defined in Section 6.5. In the resulting URI, the initial scheme up to, but not including, the following colon is then replaced by the content of the Proxy- Scheme Option. Note that this case is only applicable if the components of the desired URI other than the scheme component actually can be expressed using Uri-* options; for example, to represent a URI with a userinfo component in the authority, only Proxy-Uri can be used.

source

fn proxy_uri(&self) -> Result<Option<&str>, Utf8Error>

Get the value for the Proxy-Uri option

source

fn set_proxy_scheme<S>(&mut self, scheme: S) -> Result<(), Self::SetError>where S: AsRef<str>,

Update the value for the Proxy-Scheme option, discarding any existing values.

source

fn proxy_scheme(&self) -> Result<Option<&str>, Utf8Error>

Get the value for the Proxy-Scheme option

source

fn add_if_match<B>(&mut self, tag: B) -> Result<(), Self::SetError>where B: AsRef<[u8]>,

Insert a new value for the If-Match option, alongside any existing values.

If-Match

generated from RFC7252 section 5.10.8.1

The If-Match Option MAY be used to make a request conditional on the current existence or value of an ETag for one or more representations of the target resource. If-Match is generally useful for resource update requests, such as PUT requests, as a means for protecting against accidental overwrites when multiple clients are acting in parallel on the same resource (i.e., the “lost update” problem).

The value of an If-Match option is either an ETag or the empty string. An If-Match option with an ETag matches a representation with that exact ETag. An If-Match option with an empty value matches any existing representation (i.e., it places the precondition on the existence of any current representation for the target resource).

The If-Match Option can occur multiple times. If any of the options match, then the condition is fulfilled.

If there is one or more If-Match Options, but none of the options match, then the condition is not fulfilled.

source

fn if_match(&self) -> Option<&Self::OptValues>

Get all values for the If-Match option

source

fn add_location_path<S>(&mut self, path: S) -> Result<(), Self::SetError>where S: AsRef<str>,

Insert a new value for the Location-Path option, alongside any existing values.

Location-Path and Location-Query

generated from RFC7252 section 5.10.7

The Location-Path and Location-Query Options together indicate a relative URI that consists either of an absolute path, a query string, or both. A combination of these options is included in a 2.01 (Created) response to indicate the location of the resource created as the result of a POST request (see Section 5.8.2). The location is resolved relative to the request URI.

If a response with one or more Location-Path and/or Location-Query Options passes through a cache that interprets these options and the implied URI identifies one or more currently stored responses, those entries MUST be marked as not fresh.

Each Location-Path Option specifies one segment of the absolute path to the resource, and each Location-Query Option specifies one argument parameterizing the resource. The Location-Path and Location-Query Option can contain any character sequence. No percent-encoding is performed. The value of a Location-Path Option MUST NOT be “.” or “..”.

The steps for constructing the location URI from the options are analogous to Section 6.5, except that the first five steps are skipped and the result is a relative URI-reference, which is then interpreted relative to the request URI. Note that the relative URI- reference constructed this way always includes an absolute path (e.g., leaving out Location-Path but supplying Location-Query means the path component in the URI is “/”).

The options that are used to compute the relative URI-reference are collectively called Location-* options. Beyond Location-Path and Location-Query, more Location-* options may be defined in the future and have been reserved option numbers 128, 132, 136, and 140. If any of these reserved option numbers occurs in addition to Location-Path and/or Location-Query and are not supported, then a 4.02 (Bad Option) error MUST be returned.

source

fn location_path<'a, F>(&'a self) -> Result<F, Utf8Error>where F: FromIterator<&'a str>,

Get all values for the Location-Path option

source

fn add_location_query<S>(&mut self, query: S) -> Result<(), Self::SetError>where S: AsRef<str>,

Insert a new value for the Location-Query option, alongside any existing values.

Location-Path and Location-Query

generated from RFC7252 section 5.10.7

The Location-Path and Location-Query Options together indicate a relative URI that consists either of an absolute path, a query string, or both. A combination of these options is included in a 2.01 (Created) response to indicate the location of the resource created as the result of a POST request (see Section 5.8.2). The location is resolved relative to the request URI.

If a response with one or more Location-Path and/or Location-Query Options passes through a cache that interprets these options and the implied URI identifies one or more currently stored responses, those entries MUST be marked as not fresh.

Each Location-Path Option specifies one segment of the absolute path to the resource, and each Location-Query Option specifies one argument parameterizing the resource. The Location-Path and Location-Query Option can contain any character sequence. No percent-encoding is performed. The value of a Location-Path Option MUST NOT be “.” or “..”.

The steps for constructing the location URI from the options are analogous to Section 6.5, except that the first five steps are skipped and the result is a relative URI-reference, which is then interpreted relative to the request URI. Note that the relative URI- reference constructed this way always includes an absolute path (e.g., leaving out Location-Path but supplying Location-Query means the path component in the URI is “/”).

The options that are used to compute the relative URI-reference are collectively called Location-* options. Beyond Location-Path and Location-Query, more Location-* options may be defined in the future and have been reserved option numbers 128, 132, 136, and 140. If any of these reserved option numbers occurs in addition to Location-Path and/or Location-Query and are not supported, then a 4.02 (Bad Option) error MUST be returned.

source

fn location_query<'a, F>(&'a self) -> Result<F, Utf8Error>where F: FromIterator<&'a str>,

Get all values for the Location-Query option

source

fn add_etag<B>(&mut self, tag: B) -> Result<(), Self::SetError>where B: AsRef<[u8]>,

Insert a new value for the ETag option, alongside any existing values.

Location-Path and Location-Query

generated from RFC7252 section 5.10.7

The Location-Path and Location-Query Options together indicate a relative URI that consists either of an absolute path, a query string, or both. A combination of these options is included in a 2.01 (Created) response to indicate the location of the resource created as the result of a POST request (see Section 5.8.2). The location is resolved relative to the request URI.

If a response with one or more Location-Path and/or Location-Query Options passes through a cache that interprets these options and the implied URI identifies one or more currently stored responses, those entries MUST be marked as not fresh.

Each Location-Path Option specifies one segment of the absolute path to the resource, and each Location-Query Option specifies one argument parameterizing the resource. The Location-Path and Location-Query Option can contain any character sequence. No percent-encoding is performed. The value of a Location-Path Option MUST NOT be “.” or “..”.

The steps for constructing the location URI from the options are analogous to Section 6.5, except that the first five steps are skipped and the result is a relative URI-reference, which is then interpreted relative to the request URI. Note that the relative URI- reference constructed this way always includes an absolute path (e.g., leaving out Location-Path but supplying Location-Query means the path component in the URI is “/”).

The options that are used to compute the relative URI-reference are collectively called Location-* options. Beyond Location-Path and Location-Query, more Location-* options may be defined in the future and have been reserved option numbers 128, 132, 136, and 140. If any of these reserved option numbers occurs in addition to Location-Path and/or Location-Query and are not supported, then a 4.02 (Bad Option) error MUST be returned.

source

fn etags(&self) -> Option<&Self::OptValues>

Get all values for the ETag option

Implementors§