pub struct Ctx { /* private fields */ }Expand description
Context struct to share state across the parent and sub-request.
Implementations§
Source§impl Ctx
impl Ctx
Sourcepub fn builder() -> CtxBuilder
pub fn builder() -> CtxBuilder
Create a CtxBuilder in order to make a new subrequest Ctx.
Sourcepub fn user_ctx(&self) -> Option<&UserCtx>
pub fn user_ctx(&self) -> Option<&UserCtx>
Get a reference to the extensions inside this subrequest.
Sourcepub fn user_ctx_mut(&mut self) -> Option<&mut UserCtx>
pub fn user_ctx_mut(&mut self) -> Option<&mut UserCtx>
Get a mutable reference to the extensions inside this subrequest.
Sourcepub fn release_write_lock(&mut self)
pub fn release_write_lock(&mut self)
Release the write lock from the subrequest (to clean up a write permit that will not be used in the cache key lock).
Sourcepub fn take_write_lock(&mut self) -> Option<WritePermit>
pub fn take_write_lock(&mut self) -> Option<WritePermit>
Take the write lock from the subrequest, for use in a cache key lock.
Auto Trait Implementations§
impl Freeze for Ctx
impl !RefUnwindSafe for Ctx
impl Send for Ctx
impl Sync for Ctx
impl Unpin for Ctx
impl !UnwindSafe for Ctx
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