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, OpenAuthError>
pub fn get(&self) -> Result<T, OpenAuthError>
Get the value for this request, lazily initializing it when absent.
Sourcepub fn set(&self, value: T) -> Result<(), OpenAuthError>
pub fn set(&self, value: T) -> Result<(), OpenAuthError>
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§
Source§impl<T> Clone for RequestState<T>
impl<T> Clone for RequestState<T>
Source§fn clone(&self) -> RequestState<T>
fn clone(&self) -> RequestState<T>
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 moreAuto 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