#[repr(transparent)]pub struct ArcRecursion<T>(pub Weak<Mutex<Option<T>>>);Expand description
The possibly recursive reference to the parent anchor that must be ArcRecursive, thread safe
It is more complex to use than RcRecursive (you need to lock it before accessing the value)
See ArcRecursive for code example.
Tuple Fields§
§0: Weak<Mutex<Option<T>>>Implementations§
Source§impl<T> ArcRecursion<T>
impl<T> ArcRecursion<T>
Sourcepub fn upgrade(&self) -> Option<ArcRecursive<T>>
pub fn upgrade(&self) -> Option<ArcRecursive<T>>
Try to upgrade the weak reference to ArcRecursive<T>.
Sourcepub fn with<R>(&self, f: impl FnOnce(&T) -> R) -> Option<R>
pub fn with<R>(&self, f: impl FnOnce(&T) -> R) -> Option<R>
Access the recursive value in one step, if it is still alive.
Sourcepub fn is_dangling(&self) -> bool
pub fn is_dangling(&self) -> bool
Returns true if the underlying value has been dropped (no strong refs remain).
Trait Implementations§
Source§impl<T: Clone> Clone for ArcRecursion<T>
impl<T: Clone> Clone for ArcRecursion<T>
Source§fn clone(&self) -> ArcRecursion<T>
fn clone(&self) -> ArcRecursion<T>
Returns a duplicate 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 ArcRecursion<T>
impl<T> Debug for ArcRecursion<T>
Source§impl<'de, T> Deserialize<'de> for ArcRecursion<T>
Available on crate feature deserialize only.
impl<'de, T> Deserialize<'de> for ArcRecursion<T>
Available on crate feature
deserialize only.Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<T> From<&ArcRecursive<T>> for ArcRecursion<T>
impl<T> From<&ArcRecursive<T>> for ArcRecursion<T>
Source§fn from(ara: &ArcRecursive<T>) -> Self
fn from(ara: &ArcRecursive<T>) -> Self
Converts to this type from the input type.
Source§impl<T> PartialEq for ArcRecursion<T>
impl<T> PartialEq for ArcRecursion<T>
Source§impl<T: Serialize> Serialize for ArcRecursion<T>
impl<T: Serialize> Serialize for ArcRecursion<T>
impl<T> Eq for ArcRecursion<T>
Auto Trait Implementations§
impl<T> Freeze for ArcRecursion<T>
impl<T> RefUnwindSafe for ArcRecursion<T>
impl<T> Send for ArcRecursion<T>where
T: Send,
impl<T> Sync for ArcRecursion<T>where
T: Send,
impl<T> Unpin for ArcRecursion<T>
impl<T> UnsafeUnpin for ArcRecursion<T>
impl<T> UnwindSafe for ArcRecursion<T>
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