pub struct RequestState<T> { /* private fields */ }Expand description
Request-scoped typed value.
Implementations§
Source§impl<T> RequestState<T>
impl<T> RequestState<T>
Sourcepub fn get(&self) -> Result<T, RustAuthError>
pub fn get(&self) -> Result<T, RustAuthError>
Get the value for this request, lazily initializing it when absent.
Sourcepub fn set(&self, value: T) -> Result<(), RustAuthError>
pub fn set(&self, value: T) -> Result<(), RustAuthError>
Set the value for this request.
Sourcepub fn key(&self) -> RequestStateKey
pub fn key(&self) -> RequestStateKey
Unique key for debugging or custom stores.
Trait Implementations§
Auto Trait Implementations§
impl<T> !RefUnwindSafe for RequestState<T>
impl<T> !UnwindSafe for RequestState<T>
impl<T> Freeze for RequestState<T>
impl<T> Send for RequestState<T>
impl<T> Sync for RequestState<T>
impl<T> Unpin for RequestState<T>
impl<T> UnsafeUnpin for RequestState<T>
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