Trait GuardTransfer

Source
pub trait GuardTransfer {
    // Required method
    fn transfer_to(&mut self) -> Self;
}
Expand description

The Guard can be transferred atomically.

Required Methods§

Source

fn transfer_to(&mut self) -> Self

Atomically transfers the current guard to a new instance.

This function ensures that there are no ‘gaps’ between the destruction of the old guard and the creation of the new guard, thereby maintaining the atomicity of guard transitions.

The original guard must be dropped immediately after calling this method.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§