Skip to main content

SessionParser

Trait SessionParser 

Source
pub trait SessionParser<T> {
    // Required methods
    fn from_str(source: String) -> Result<T, Error>;
    fn to_string(source: T) -> Result<String, Error>;
}
Expand description

SessionParser trait for serializing and deserializing session content

The crate provides a json implementaton, JsonSessionParser. It should be straight forward to implement other parsers (like url-encoding, for example)

Required Methods§

Source

fn from_str(source: String) -> Result<T, Error>

Function to be called when a valid String has been obtained from SessionCreator.

Source

fn to_string(source: T) -> Result<String, Error>

Function to call when a valid String is to be sent to SessionCreator.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§