pub struct TestSession {
pub id: String,
pub user_id: Uuid,
pub user_name: String,
pub user_email: String,
pub roles: Vec<String>,
pub permissions: Vec<String>,
pub created_at: DateTime<Utc>,
pub expires_at: DateTime<Utc>,
pub data: HashMap<String, Value>,
}Expand description
Test session structure
Fields§
§id: String§user_id: Uuid§user_name: String§user_email: String§roles: Vec<String>§permissions: Vec<String>§created_at: DateTime<Utc>§expires_at: DateTime<Utc>§data: HashMap<String, Value>Implementations§
Source§impl TestSession
impl TestSession
Sourcepub fn is_expired(&self) -> bool
pub fn is_expired(&self) -> bool
Check if session is expired
Sourcepub fn has_permission(&self, permission: &str) -> bool
pub fn has_permission(&self, permission: &str) -> bool
Check if user has a specific permission
Trait Implementations§
Source§impl Clone for TestSession
impl Clone for TestSession
Source§fn clone(&self) -> TestSession
fn clone(&self) -> TestSession
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TestSession
impl RefUnwindSafe for TestSession
impl Send for TestSession
impl Sync for TestSession
impl Unpin for TestSession
impl UnwindSafe for TestSession
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more