pub struct Session { /* private fields */ }Expand description
Changes reach the cookie only once the handler’s outcome has committed.
Implementations§
Source§impl Session
impl Session
Sourcepub fn sign_in<A: Area>(
&self,
right: SignInRight,
principal: Id<PrincipalRecord<A>>,
) -> Result<Uuid>
pub fn sign_in<A: Area>( &self, right: SignInRight, principal: Id<PrincipalRecord<A>>, ) -> Result<Uuid>
Issues a fresh cookie, so no session value from before signing in stays valid; whether
the principal may enter the area is the caller’s to check. An action without a
SignInRight cannot sign anyone in:
ⓘ
fn sign_in_anyone<A: Area>(session: &Session, anyone: sofie_db::Id<PrincipalRecord<A>>) {
let _ = session.sign_in::<A>(anyone);
}pub fn current(&self) -> Option<Uuid>
pub fn sign_out(&self)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Session
impl RefUnwindSafe for Session
impl Send for Session
impl Sync for Session
impl Unpin for Session
impl UnsafeUnpin for Session
impl UnwindSafe for Session
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