pub struct ArenaItem<T, S = SyncStorage> { /* private fields */ }
Expand description
A copyable, stable reference for any value, stored on the arena whose ownership is managed by the reactive ownership tree.
Implementations§
Source§impl<T, S> ArenaItem<T, S>where
T: 'static,
S: Storage<T>,
impl<T, S> ArenaItem<T, S>where
T: 'static,
S: Storage<T>,
Sourcepub fn new_with_storage(value: T) -> Self
pub fn new_with_storage(value: T) -> Self
Stores the given value in the arena allocator.
Source§impl<T> ArenaItem<T, LocalStorage>where
T: 'static,
impl<T> ArenaItem<T, LocalStorage>where
T: 'static,
Source§impl<T, S: Storage<T>> ArenaItem<T, S>
impl<T, S: Storage<T>> ArenaItem<T, S>
Sourcepub fn try_with_value<U>(&self, fun: impl FnOnce(&T) -> U) -> Option<U>
pub fn try_with_value<U>(&self, fun: impl FnOnce(&T) -> U) -> Option<U>
Applies a function to a reference to the stored value and returns the result, or None
if it has already been disposed.
Sourcepub fn try_update_value<U>(&self, fun: impl FnOnce(&mut T) -> U) -> Option<U>
pub fn try_update_value<U>(&self, fun: impl FnOnce(&mut T) -> U) -> Option<U>
Applies a function to a mutable reference to the stored value and returns the result, or None
if it has already been disposed.
Trait Implementations§
Source§impl<T, S> IsDisposed for ArenaItem<T, S>
impl<T, S> IsDisposed for ArenaItem<T, S>
Source§fn is_disposed(&self) -> bool
fn is_disposed(&self) -> bool
If
true
, the signal cannot be accessed without a panic.impl<T, S> Copy for ArenaItem<T, S>
impl<T, S> Eq for ArenaItem<T, S>
Auto Trait Implementations§
impl<T, S> Freeze for ArenaItem<T, S>
impl<T, S> RefUnwindSafe for ArenaItem<T, S>
impl<T, S> Send for ArenaItem<T, S>
impl<T, S> Sync for ArenaItem<T, S>
impl<T, S> Unpin for ArenaItem<T, S>
impl<T, S> UnwindSafe for ArenaItem<T, S>
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<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> StorageAccess<T> for T
impl<T> StorageAccess<T> for T
Source§fn as_borrowed(&self) -> &T
fn as_borrowed(&self) -> &T
Borrows the value.
Source§fn into_taken(self) -> T
fn into_taken(self) -> T
Takes the value.