pub struct CookieSessionRecord { /* private fields */ }Expand description
Cookie-specific session record with binary (postcard) serialization.
This is the legacy wire format used by the cookie auth flow. It carries
deprecated fields (name, user_agent) and a version byte for backward
compatibility with existing clients.
When the cookie flow is retired, this struct can be deleted.
Implementations§
Source§impl CookieSessionRecord
impl CookieSessionRecord
Sourcepub fn new(
public_key: &PublicKey,
capabilities: Capabilities,
user_agent: Option<String>,
) -> Self
pub fn new( public_key: &PublicKey, capabilities: Capabilities, user_agent: Option<String>, ) -> Self
Create a new cookie session record.
Sourcepub fn public_key(&self) -> &PublicKey
pub fn public_key(&self) -> &PublicKey
Returns the public_key of this session authorizes for.
Sourcepub fn capabilities(&self) -> &[Capability]
pub fn capabilities(&self) -> &[Capability]
Returns the capabilities this session provide on this session’s public_key’s resources.
Sourcepub fn created_at(&self) -> u64
pub fn created_at(&self) -> u64
Returns the timestamp when this session was created.
Sourcepub fn set_created_at(&mut self, created_at: u64) -> &mut Self
pub fn set_created_at(&mut self, created_at: u64) -> &mut Self
Set the timestamp when this session was created.
Sourcepub fn set_capabilities(&mut self, capabilities: Capabilities) -> &mut Self
pub fn set_capabilities(&mut self, capabilities: Capabilities) -> &mut Self
Set this session’s capabilities.
Sourcepub fn serialize(&self) -> Vec<u8> ⓘ
pub fn serialize(&self) -> Vec<u8> ⓘ
Serialize this session to its canonical binary representation.
Sourcepub fn deserialize(bytes: &[u8]) -> Result<Self, Error>
pub fn deserialize(bytes: &[u8]) -> Result<Self, Error>
Deserialize this session from its canonical binary representation.
Trait Implementations§
Source§impl Clone for CookieSessionRecord
impl Clone for CookieSessionRecord
Source§fn clone(&self) -> CookieSessionRecord
fn clone(&self) -> CookieSessionRecord
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CookieSessionRecord
impl Debug for CookieSessionRecord
Source§impl<'de> Deserialize<'de> for CookieSessionRecord
impl<'de> Deserialize<'de> for CookieSessionRecord
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for CookieSessionRecord
Source§impl PartialEq for CookieSessionRecord
impl PartialEq for CookieSessionRecord
Source§impl Serialize for CookieSessionRecord
impl Serialize for CookieSessionRecord
impl StructuralPartialEq for CookieSessionRecord
Auto Trait Implementations§
impl Freeze for CookieSessionRecord
impl RefUnwindSafe for CookieSessionRecord
impl Send for CookieSessionRecord
impl Sync for CookieSessionRecord
impl Unpin for CookieSessionRecord
impl UnsafeUnpin for CookieSessionRecord
impl UnwindSafe for CookieSessionRecord
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