pub struct Session {
pub id: SessionId,
pub key: SessionKey,
pub cursor: SessionCursor,
pub meta: SessionMeta,
pub outbox: Vec<OutboxEntry>,
pub updated_at: OffsetDateTime,
pub ttl_secs: u32,
}Fields§
§id: SessionId§key: SessionKey§cursor: SessionCursor§meta: SessionMeta§outbox: Vec<OutboxEntry>§updated_at: OffsetDateTime§ttl_secs: u32Implementations§
Source§impl Session
impl Session
Sourcepub fn normalize(&mut self)
pub fn normalize(&mut self)
Applies in-place cleanup such as outbox deduplication and ttl normalization.
Sourcepub fn dedupe_outbox(&mut self)
pub fn dedupe_outbox(&mut self)
Deduplicates the outbox by (seq, payload_sha256) while maintaining first-wins ordering.
Sourcepub fn expires_at(&self) -> Option<OffsetDateTime>
pub fn expires_at(&self) -> Option<OffsetDateTime>
Returns the computed expiry deadline based on updated_at + ttl_secs.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Session
impl<'de> Deserialize<'de> for Session
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
Auto Trait Implementations§
impl Freeze for Session
impl RefUnwindSafe for Session
impl Send for Session
impl Sync for Session
impl Unpin 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