pub struct AtomicRefCell<T>where
T: ?Sized,{ /* private fields */ }
Expand description
A threadsafe analogue to RefCell.
Implementations§
Source§impl<T> AtomicRefCell<T>
impl<T> AtomicRefCell<T>
Sourcepub const fn new(value: T) -> AtomicRefCell<T>
pub const fn new(value: T) -> AtomicRefCell<T>
Creates a new AtomicRefCell
containing value
.
Sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Consumes the AtomicRefCell
, returning the wrapped value.
Source§impl<T> AtomicRefCell<T>where
T: ?Sized,
impl<T> AtomicRefCell<T>where
T: ?Sized,
Sourcepub fn try_borrow(&self) -> Result<AtomicRef<'_, T>, BorrowError>
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
.
Sourcepub fn borrow_mut(&self) -> AtomicRefMut<'_, T>
pub fn borrow_mut(&self) -> AtomicRefMut<'_, T>
Mutably borrows the wrapped value.
Sourcepub fn try_borrow_mut(&self) -> Result<AtomicRefMut<'_, T>, BorrowMutError>
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
.
Trait Implementations§
Source§impl<T> Clone for AtomicRefCell<T>where
T: Clone,
impl<T> Clone for AtomicRefCell<T>where
T: Clone,
Source§fn clone(&self) -> AtomicRefCell<T>
fn clone(&self) -> AtomicRefCell<T>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<T> Debug for AtomicRefCell<T>
impl<T> Debug for AtomicRefCell<T>
Source§impl<T> Default for AtomicRefCell<T>where
T: Default,
impl<T> Default for AtomicRefCell<T>where
T: Default,
Source§fn default() -> AtomicRefCell<T>
fn default() -> AtomicRefCell<T>
Returns the “default value” for a type. Read more
Source§impl<T> From<T> for AtomicRefCell<T>
impl<T> From<T> for AtomicRefCell<T>
Source§fn from(t: T) -> AtomicRefCell<T>
fn from(t: T) -> AtomicRefCell<T>
Converts to this type from the input type.
Source§impl<T> Ord for AtomicRefCell<T>
impl<T> Ord for AtomicRefCell<T>
Source§fn cmp(&self, other: &AtomicRefCell<T>) -> Ordering
fn cmp(&self, other: &AtomicRefCell<T>) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<T> PartialEq for AtomicRefCell<T>
impl<T> PartialEq for AtomicRefCell<T>
Source§impl<T> PartialOrd for AtomicRefCell<T>where
T: PartialOrd + ?Sized,
impl<T> PartialOrd for AtomicRefCell<T>where
T: PartialOrd + ?Sized,
impl<T> Eq for AtomicRefCell<T>
impl<T> Send for AtomicRefCell<T>
impl<T> Sync for AtomicRefCell<T>
Auto Trait Implementations§
impl<T> !Freeze for AtomicRefCell<T>
impl<T> !RefUnwindSafe for AtomicRefCell<T>
impl<T> Unpin for AtomicRefCell<T>
impl<T> UnwindSafe for AtomicRefCell<T>where
T: UnwindSafe + ?Sized,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian()
.