[][src]Struct loom::cell::CausalCell

pub struct CausalCell<T> { /* fields omitted */ }

CausalCell ensures access to the inner value are valid under the Rust memory model.

Methods

impl<T> CausalCell<T>[src]

pub fn new(data: T) -> CausalCell<T>[src]

Construct a new instance of CausalCell which will wrap the specified value.

pub fn with<F, R>(&self, f: F) -> R where
    F: FnOnce(*const T) -> R, 
[src]

Get an immutable pointer to the wrapped value.

Panics

This function will panic if the access is not valid under the Rust memory model.

pub fn with_deferred<F, R>(&self, f: F) -> (R, CausalCheck) where
    F: FnOnce(*const T) -> R, 
[src]

Get an immutable pointer to the wrapped value, deferring the causality check.

Panics

This function will panic if the access is not valid under the Rust memory model.

pub fn with_mut<F, R>(&self, f: F) -> R where
    F: FnOnce(*mut T) -> R, 
[src]

Get a mutable pointer to the wrapped value.

Panics

This function will panic if the access is not valid under the Rust memory model.

pub fn with_deferred_mut<F, R>(&self, f: F) -> (R, CausalCheck) where
    F: FnOnce(*mut T) -> R, 
[src]

Get a mutable pointer to the wrapped value.

Panics

This function will panic if the access is not valid under the Rust memory model.

pub fn with_unchecked<F, R>(&self, f: F) -> R where
    F: FnOnce(*const T) -> R, 
[src]

Get an immutable pointer to the wrapped value.

pub fn with_mut_unchecked<F, R>(&self, f: F) -> R where
    F: FnOnce(*mut T) -> R, 
[src]

Get a mutable pointer to the wrapped value.

pub fn check(&self)[src]

Check that the current thread can make an immutable access without violating the Rust memory model.

Specifically, this function checks that there is no concurrent mutable access with this immutable access, while allowing many concurrent immutable accesses.

pub fn check_mut(&self)[src]

Check that the current thread can make a mutable access without violating the Rust memory model.

Specifically, this function checks that there is no concurrent mutable access and no concurrent immutable access(es) with this mutable access.

Trait Implementations

impl<T: Debug> Debug for CausalCell<T>[src]

Auto Trait Implementations

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

impl<T> !Sync for CausalCell<T>

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

impl<T> UnwindSafe for CausalCell<T> where
    T: UnwindSafe

impl<T> !RefUnwindSafe for CausalCell<T>

Blanket Implementations

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

impl<T> From<T> for 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.

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

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

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