Struct HubSwitchGuard
pub struct HubSwitchGuard { /* private fields */ }
Expand description
A Hub switch guard used to temporarily swap active hub in thread local storage.
Implementations§
§impl SwitchGuard
impl SwitchGuard
pub fn new(hub: Arc<Hub>) -> SwitchGuard
pub fn new(hub: Arc<Hub>) -> SwitchGuard
Swaps the current thread’s Hub by the one provided and returns a guard that, when dropped, replaces it to the previous one.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SwitchGuard
impl RefUnwindSafe for SwitchGuard
impl Send for SwitchGuard
impl Sync for SwitchGuard
impl Unpin for SwitchGuard
impl UnwindSafe for SwitchGuard
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