Type Alias RuleState

Source
pub(crate) type RuleState<R> = AtomicRefCell<R>;

Aliased Type§

struct RuleState<R> { /* private fields */ }

Implementations

§

impl<T> AtomicRefCell<T>

pub const fn new(value: T) -> AtomicRefCell<T>

Creates a new AtomicRefCell containing value.

pub fn into_inner(self) -> T

Consumes the AtomicRefCell, returning the wrapped value.

§

impl<T> AtomicRefCell<T>
where T: ?Sized,

pub fn borrow(&self) -> AtomicRef<'_, T>

Immutably borrows the wrapped value.

pub fn try_borrow(&self) -> Result<AtomicRef<'_, T>, BorrowError>

Attempts to immutably borrow the wrapped value, but instead of panicking on a failed borrow, returns Err.

pub fn borrow_mut(&self) -> AtomicRefMut<'_, T>

Mutably borrows the wrapped value.

pub fn try_borrow_mut(&self) -> Result<AtomicRefMut<'_, T>, BorrowMutError>

Attempts to mutably borrow the wrapped value, but instead of panicking on a failed borrow, returns Err.

pub fn as_ptr(&self) -> *mut T

Returns a raw pointer to the underlying data in this cell.

External synchronization is needed to avoid data races when dereferencing the pointer.

pub fn get_mut(&mut self) -> &mut T

Returns a mutable reference to the wrapped value.

No runtime checks take place (unless debug assertions are enabled) because this call borrows AtomicRefCell mutably at compile-time.

Trait Implementations

§

impl<T> Clone for AtomicRefCell<T>
where T: Clone,

§

fn clone(&self) -> AtomicRefCell<T>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl<T> Debug for AtomicRefCell<T>
where T: Debug + ?Sized,

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<T> Default for AtomicRefCell<T>
where T: Default,

§

fn default() -> AtomicRefCell<T>

Returns the “default value” for a type. Read more
§

impl<T> From<T> for AtomicRefCell<T>

§

fn from(t: T) -> AtomicRefCell<T>

Converts to this type from the input type.
§

impl<T> Ord for AtomicRefCell<T>
where T: Ord + ?Sized,

§

fn cmp(&self, other: &AtomicRefCell<T>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
§

impl<T> PartialEq for AtomicRefCell<T>
where T: PartialEq + ?Sized,

§

fn eq(&self, other: &AtomicRefCell<T>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl<T> PartialOrd for AtomicRefCell<T>
where T: PartialOrd + ?Sized,

§

fn partial_cmp(&self, other: &AtomicRefCell<T>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
§

impl<T> Eq for AtomicRefCell<T>
where T: Eq + ?Sized,

§

impl<T> Send for AtomicRefCell<T>
where T: Send + ?Sized,

§

impl<T> Sync for AtomicRefCell<T>
where T: Send + Sync + ?Sized,