[−][src]Struct beefeater::Beefeater
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]
Lhs: AddAssign<Rhs>,
fn add_assign(&self, val: 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]
Lhs: AddAssign<Rhs>,
impl<Lhs: Copy, Rhs> FetchSub<Lhs, Rhs> for Beefeater<Lhs> where
Lhs: SubAssign<Rhs>,
[src]
Lhs: SubAssign<Rhs>,
impl<Lhs: Copy, Rhs> SubAssign<Rhs> for Beefeater<Lhs> where
Lhs: SubAssign<Rhs>,
[src]
Lhs: SubAssign<Rhs>,
fn sub_assign(&self, val: 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,
T: Send,
impl<T> Unpin for Beefeater<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for Beefeater<T>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,