[][src]Struct lelet_utils::Spinlock

pub struct Spinlock<T: ?Sized> { /* fields omitted */ }

A simple spinlock.

copied from crossbeam_channel::utils because it is private in that crate

Methods

impl<T> Spinlock<T>[src]

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

Returns a new spinlock initialized with value.

pub fn lock(&self) -> SpinlockGuard<T>[src]

Locks the spinlock.

Trait Implementations

impl<T: ?Sized + Send> Sync for Spinlock<T>[src]

Auto Trait Implementations

impl<T> !RefUnwindSafe for Spinlock<T>

impl<T: ?Sized> Send for Spinlock<T> where
    T: Send

impl<T: ?Sized> Unpin for Spinlock<T> where
    T: Unpin

impl<T: ?Sized> UnwindSafe for Spinlock<T> where
    T: UnwindSafe

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.