pub unsafe trait SingletonTokenFactory {
    fn take() -> bool;
    unsafe fn return();
}
Expand description

Associates a type with a flag indicating whether an instance of SingletonToken<Self> is present.

Enables the SingletonToken::<Self>::new method.

Use impl_singleton_token_factory! to implement this trait.

Safety

Implementing this trait incorrectly might break Token’s invariants.

Required Methods

Take a token. Returns true if successful.

Return a token.

Safety

Each call to this method must be accompanied with the destruction of an actually-existing instance of SingletonToken.

Implementors