#[repr(transparent)]pub struct RcRecursion<T>(pub Weak<RefCell<Option<T>>>);Expand description
The possibly recursive reference to the parent anchor that must be RcRecursive.
See RcRecursive for code example.
Tuple Fields§
§0: Weak<RefCell<Option<T>>>Implementations§
Source§impl<T> RcRecursion<T>
impl<T> RcRecursion<T>
Sourcepub fn upgrade(&self) -> Option<RcRecursive<T>>
pub fn upgrade(&self) -> Option<RcRecursive<T>>
Try to upgrade the weak reference to RcRecursive<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 RcRecursion<T>
impl<T: Clone> Clone for RcRecursion<T>
Source§fn clone(&self) -> RcRecursion<T>
fn clone(&self) -> RcRecursion<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 RcRecursion<T>
impl<T> Debug for RcRecursion<T>
Source§impl<'de, T> Deserialize<'de> for RcRecursion<T>where
T: Deserialize<'de> + 'static,
Available on crate feature deserialize only.
impl<'de, T> Deserialize<'de> for RcRecursion<T>where
T: Deserialize<'de> + 'static,
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<&RcRecursive<T>> for RcRecursion<T>
impl<T> From<&RcRecursive<T>> for RcRecursion<T>
Source§fn from(rca: &RcRecursive<T>) -> Self
fn from(rca: &RcRecursive<T>) -> Self
Converts to this type from the input type.
Source§impl<T> PartialEq for RcRecursion<T>
impl<T> PartialEq for RcRecursion<T>
Source§impl<T: Serialize> Serialize for RcRecursion<T>
impl<T: Serialize> Serialize for RcRecursion<T>
impl<T> Eq for RcRecursion<T>
Auto Trait Implementations§
impl<T> Freeze for RcRecursion<T>
impl<T> !RefUnwindSafe for RcRecursion<T>
impl<T> !Send for RcRecursion<T>
impl<T> !Sync for RcRecursion<T>
impl<T> Unpin for RcRecursion<T>
impl<T> UnsafeUnpin for RcRecursion<T>
impl<T> !UnwindSafe for RcRecursion<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