Session

Trait Session 

Source
pub trait Session: Sized {
Show 26 methods // Required methods fn new(ttl_minutes: u16) -> DceResult<Self>; fn new_with_id(sid_pool: Vec<String>) -> DceResult<Self>; fn meta(&self) -> &Meta; fn meta_mut(&mut self) -> &mut Meta; fn gen_key(sid_prefix: &str, id: &str) -> String; fn silent_set(&mut self, field: &str, value: &str) -> DceResult<bool>; fn silent_get(&mut self, field: &str) -> DceResult<String>; fn silent_del(&mut self, field: &str) -> DceResult<bool>; fn destroy(&mut self) -> DceResult<bool>; fn touch(&mut self) -> DceResult<bool>; fn load(&mut self, data: HashMap<String, String>) -> DceResult<bool>; fn raw(&mut self) -> DceResult<HashMap<String, String>>; fn ttl_passed(&mut self) -> DceResult<u32>; fn cloned_mut(&mut self) -> &mut Option<Box<Self>>; fn cloned_silent_set(&mut self, field: &str, value: &str) -> DceResult<bool>; fn cloned_destroy(&mut self) -> DceResult<bool>; fn cloned_touch(&mut self) -> DceResult<bool>; fn cloned_ttl_passed(&mut self) -> DceResult<u32>; // Provided methods fn id(&self) -> &str { ... } fn key(&self) -> String { ... } fn set<T: Serialize + Sync>( &mut self, field: &str, value: &T, ) -> DceResult<bool> { ... } fn get<T: for<'a> Deserialize<'a> + Send>( &mut self, field: &str, ) -> DceResult<T> { ... } fn del(&mut self, field: &str) -> DceResult<bool> { ... } fn try_touch(&mut self) -> DceResult<bool> { ... } fn renew( &mut self, filters: HashMap<String, Option<String>>, ) -> DceResult<bool> where Self: Send { ... } fn clone_with_id(&mut self, id: String) -> DceResult<Self> where Self: Clone { ... }
}

Required Methods§

Source

fn new(ttl_minutes: u16) -> DceResult<Self>

Source

fn new_with_id(sid_pool: Vec<String>) -> DceResult<Self>

Source

fn meta(&self) -> &Meta

Source

fn meta_mut(&mut self) -> &mut Meta

Source

fn gen_key(sid_prefix: &str, id: &str) -> String

Source

fn silent_set(&mut self, field: &str, value: &str) -> DceResult<bool>

Source

fn silent_get(&mut self, field: &str) -> DceResult<String>

Source

fn silent_del(&mut self, field: &str) -> DceResult<bool>

Source

fn destroy(&mut self) -> DceResult<bool>

Source

fn touch(&mut self) -> DceResult<bool>

Source

fn load(&mut self, data: HashMap<String, String>) -> DceResult<bool>

Source

fn raw(&mut self) -> DceResult<HashMap<String, String>>

Source

fn ttl_passed(&mut self) -> DceResult<u32>

Source

fn cloned_mut(&mut self) -> &mut Option<Box<Self>>

Source

fn cloned_silent_set(&mut self, field: &str, value: &str) -> DceResult<bool>

Source

fn cloned_destroy(&mut self) -> DceResult<bool>

Source

fn cloned_touch(&mut self) -> DceResult<bool>

Source

fn cloned_ttl_passed(&mut self) -> DceResult<u32>

Provided Methods§

Source

fn id(&self) -> &str

Source

fn key(&self) -> String

Source

fn set<T: Serialize + Sync>( &mut self, field: &str, value: &T, ) -> DceResult<bool>

Source

fn get<T: for<'a> Deserialize<'a> + Send>( &mut self, field: &str, ) -> DceResult<T>

Source

fn del(&mut self, field: &str) -> DceResult<bool>

Source

fn try_touch(&mut self) -> DceResult<bool>

Source

fn renew(&mut self, filters: HashMap<String, Option<String>>) -> DceResult<bool>
where Self: Send,

Source

fn clone_with_id(&mut self, id: String) -> DceResult<Self>
where Self: Clone,

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§