Struct lite_session::LiteSessionData[][src]

pub struct LiteSessionData { /* fields omitted */ }

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]

impl Debug for LiteSessionData[src]

impl Default for LiteSessionData[src]

impl PartialEq<LiteSessionData> for LiteSessionData[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.