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§
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,
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.