pub struct CacheVersionContext { /* private fields */ }Expand description
Immutable inputs to the cache version policy.
Creation exposes raw trusted adapter output. Physical findSession reads and cache hits expose their already-filtered snapshots. Only the public projection enters signed cookie data; cached inputs have no original database models.
Implementations§
Source§impl CacheVersionContext
impl CacheVersionContext
Sourcepub fn created<U: AuthUser, T: AuthSession>(
user: U,
session: T,
user_view: UserView,
session_view: SessionView,
) -> Self
pub fn created<U: AuthUser, T: AuthSession>( user: U, session: T, user_view: UserView, session_view: SessionView, ) -> Self
Retain genuine stored models and their canonical view projection.
Sourcepub fn cached(user: UserView, session: SessionView) -> Self
pub fn cached(user: UserView, session: SessionView) -> Self
A cache hit has no original database models.
pub const fn source(&self) -> CacheVersionSource
pub const fn user(&self) -> &UserView
pub const fn session(&self) -> &SessionView
Sourcepub const fn user_output(&self) -> Option<&AdapterOutput>
pub const fn user_output(&self) -> Option<&AdapterOutput>
Actual callback-stage adapter values. Cache hits have no retained record;
their exact values remain available through user() and session().
pub const fn session_output(&self) -> Option<&AdapterOutput>
pub fn stored_user<T: AuthUser>(&self) -> Option<&T>
pub fn stored_session<T: AuthSession>(&self) -> Option<&T>
Trait Implementations§
Source§impl Clone for CacheVersionContext
impl Clone for CacheVersionContext
Auto Trait Implementations§
impl !RefUnwindSafe for CacheVersionContext
impl !UnwindSafe for CacheVersionContext
impl Freeze for CacheVersionContext
impl Send for CacheVersionContext
impl Sync for CacheVersionContext
impl Unpin for CacheVersionContext
impl UnsafeUnpin for CacheVersionContext
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