Trait rusty_express::prelude::SessionData
source · pub trait SessionData {
fn serialize(&self) -> String;
fn deserialize(raw: &str) -> Option<Self>
where
Self: Sized;
}
Expand description
SessionData is the trait that must be implemented for storing the session related information into the session store service provided by this module. The ‘serialize’ function is used to destruct the session object for persistent storage (currently only supporting plain text file); the ‘deserialize’ serves as the constructor based on the saved info from the saved info.
Required Methods§
sourcefn serialize(&self) -> String
fn serialize(&self) -> String
‘serialize’ should be implemented to convert all session data that shall be persistent between http requests or connections. Note: ASCII characters \u{0005} and \u{0006} are reserved delimiters, please avoid using these characters in your output string.
sourcefn deserialize(raw: &str) -> Option<Self>where
Self: Sized,
fn deserialize(raw: &str) -> Option<Self>where
Self: Sized,
‘deserialize’ should be implemented to construct the session object based on the given string, which shall be used for providing session-specific information for persistent http requests or connections. Note: ASCII characters \u{0005} and \u{0006} are reserved delimiters, please avoid using these characters in your output string.