[][src]Struct beefeater::Beefeater

pub struct Beefeater<T: Copy>(_);

A generic guard around any type that implements Copy, which allows an object to be safely shared between threads.

Methods

impl<T: Copy> Beefeater<T>[src]

pub fn new(value: T) -> Beefeater<T>[src]

Creates a new Beefeater.

pub fn load(&self) -> T[src]

Loads the current value from the Beefeater.

pub fn store(&self, val: T)[src]

Stores a new value into the Beefeater.

pub fn swap(&self, val: T) -> T[src]

Store a new value into the Beefeater, returning the old value.

Trait Implementations

impl<Lhs: Copy, Rhs> AddAssign<Rhs> for Beefeater<Lhs> where
    Lhs: AddAssign<Rhs>, 
[src]

impl<T: Copy + Debug> Debug for Beefeater<T>[src]

impl<T: Copy + Default> Default for Beefeater<T>[src]

impl<Lhs: Copy, Rhs> FetchAdd<Lhs, Rhs> for Beefeater<Lhs> where
    Lhs: AddAssign<Rhs>, 
[src]

impl<Lhs: Copy, Rhs> FetchSub<Lhs, Rhs> for Beefeater<Lhs> where
    Lhs: SubAssign<Rhs>, 
[src]

impl<Lhs: Copy, Rhs> SubAssign<Rhs> for Beefeater<Lhs> where
    Lhs: SubAssign<Rhs>, 
[src]

impl<T: Copy + Send> Sync for Beefeater<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for Beefeater<T>

impl<T> Send for Beefeater<T> where
    T: Send

impl<T> Unpin for Beefeater<T> where
    T: Unpin

impl<T> UnwindSafe for Beefeater<T>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.