Struct lite_session::LiteSessionData [−][src]
The data part of the token which contains additional client identifying data
use lite_session::Role; pub struct LiteSessionData { username: String, role: Role, tag: Option<String>, acl: Vec<String>, }
Implementations
impl LiteSessionData
[src]
pub fn username(&mut self, value: &str) -> &mut Self
[src]
Add a custom username
pub fn role(&mut self, role: Role) -> &mut Self
[src]
A a desired Role
from the list of provided by the Role
module
pub fn tag(&mut self, tag: &str) -> &mut Self
[src]
Add a custom tag to identify this token or current client/server/node
pub fn add_acl(&mut self, capability: &str) -> &mut Self
[src]
Add a capability to the access control list
pub fn remove_acl(&mut self, capability: &str) -> Option<String>
[src]
Remove a capability from the access control list
pub fn get_username(&self) -> &String
[src]
Get the username
pub fn get_role(&self) -> &Role
[src]
Get the role
pub fn get_tag(&self) -> &Option<String>
[src]
Get the tag
pub fn get_acl(&self) -> &Vec<String>
[src]
Get the access control list of capabilities
pub fn build(&self) -> String
[src]
Build the data to a string that can be attached to a token
pub fn destructure(self, data: &str) -> Result<Self, LiteSessionError>
[src]
Destructure the current cipher text into its components and check if they are valid
Trait Implementations
impl Clone for LiteSessionData
[src]
fn clone(&self) -> Self
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for LiteSessionData
[src]
impl Default for LiteSessionData
[src]
impl PartialEq<LiteSessionData> for LiteSessionData
[src]
Auto Trait Implementations
impl RefUnwindSafe for LiteSessionData
[src]
impl Send for LiteSessionData
[src]
impl Sync for LiteSessionData
[src]
impl Unpin for LiteSessionData
[src]
impl UnwindSafe for LiteSessionData
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,