LockChoice

Trait LockChoice 

Source
pub trait LockChoice {
    type Lock<T>: Lock<T>;

    // Provided method
    fn new_locked<T>(t: T) -> Self::Lock<T> { ... }
}
Expand description

A type that allows choosing between different locking mechanisms for the backing buffer of the pk2 archive.

Required Associated Types§

Source

type Lock<T>: Lock<T>

The type of lock to be used.

Provided Methods§

Source

fn new_locked<T>(t: T) -> Self::Lock<T>

Wrap the value in our lock.

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§

Source§

impl LockChoice for pk2_sync::sync::Lock

Source§

type Lock<T> = Mutex<T>

Source§

impl LockChoice for pk2_sync::unsync::Lock

Source§

type Lock<T> = RefCell<T>