pub struct OriginScope { /* private fields */ }Expand description
RAII guard that overrides the write origin for the current thread for its lifetime, restoring the previous value on drop. Required for the remote server: tokio reuses blocking threads, so a bare set would leak one request’s user into the next request on the same thread. Empty input is treated as “no override” (the guard still restores the prior value on drop).
Implementations§
Trait Implementations§
Source§impl Drop for OriginScope
impl Drop for OriginScope
Auto Trait Implementations§
impl Freeze for OriginScope
impl RefUnwindSafe for OriginScope
impl Send for OriginScope
impl Sync for OriginScope
impl Unpin for OriginScope
impl UnsafeUnpin for OriginScope
impl UnwindSafe for OriginScope
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