#[non_exhaustive]pub struct SessionHeader {
pub id: String,
pub timeout: Option<Duration>,
pub extensions: Vec<(String, Option<String>)>,
}Expand description
A parsed Session header (RFC 2326 §12.37).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.id: StringThe session identifier (opaque).
timeout: Option<Duration>The declared timeout, if any (a malformed value is DEFAULT_SESSION_TIMEOUT).
extensions: Vec<(String, Option<String>)>Unknown parameters (name, value) in input order.
Implementations§
Source§impl SessionHeader
impl SessionHeader
Sourcepub fn parse(value: &str) -> Result<Self>
pub fn parse(value: &str) -> Result<Self>
Parses a Session field value; see the module docs for the leniency rules.
Sourcepub fn parse_with_warnings(value: &str) -> Result<(Self, Vec<String>)>
pub fn parse_with_warnings(value: &str) -> Result<(Self, Vec<String>)>
Like parse, also returning the recoverable problems found
(e.g. a malformed timeout that fell back to the default).
Sourcepub fn to_header_value(&self) -> Result<String>
pub fn to_header_value(&self) -> Result<String>
Canonical serialization: id[;timeout=N][;ext[=value]]….
§Errors
Error::HeaderSerialize if the id is not a valid session-id, an extension
name is not an RFC 2326 §15.1 token, or a value holds a control character;
nothing unsafe is ever written.
Trait Implementations§
Source§impl Clone for SessionHeader
impl Clone for SessionHeader
Source§impl Debug for SessionHeader
impl Debug for SessionHeader
Source§impl<'de> Deserialize<'de> for SessionHeader
impl<'de> Deserialize<'de> for SessionHeader
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for SessionHeader
Source§impl PartialEq for SessionHeader
impl PartialEq for SessionHeader
Source§impl Serialize for SessionHeader
impl Serialize for SessionHeader
impl StructuralPartialEq for SessionHeader
Auto Trait Implementations§
impl Freeze for SessionHeader
impl RefUnwindSafe for SessionHeader
impl Send for SessionHeader
impl Sync for SessionHeader
impl Unpin for SessionHeader
impl UnsafeUnpin for SessionHeader
impl UnwindSafe for SessionHeader
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
Mutably borrows from an owned value. Read more