pub struct ArcField<T>where
T: 'static,{ /* private fields */ }Expand description
Reference-counted access to a single field of type T.
This can be used to erase the chain of field-accessors, to make it easier to pass this into another component or function without needing to specify the full type signature.
Trait Implementations§
Source§impl<T> DefinedAt for ArcField<T>
impl<T> DefinedAt for ArcField<T>
Source§fn defined_at(&self) -> Option<&'static Location<'static>>
fn defined_at(&self) -> Option<&'static Location<'static>>
Returns the location at which the signal was defined. This is usually simply
None in
release mode.Source§impl<Inner, Prev, K, T> From<AtKeyed<Inner, Prev, K, T>> for ArcField<T::Value>where
AtKeyed<Inner, Prev, K, T>: Clone,
K: Clone + Debug + Send + Sync + PartialEq + Eq + Hash + 'static,
KeyedSubfield<Inner, Prev, K, T>: Clone,
T: KeyedIterable + KeyedAccess<K> + 'static,
for<'a> &'a T: IntoIterator<Item = <T as KeyedIterable>::IterItem<'a>>,
Inner: StoreField<Value = Prev> + IsDisposed + Send + Sync + 'static,
Prev: 'static,
T::Value: Sized,
impl<Inner, Prev, K, T> From<AtKeyed<Inner, Prev, K, T>> for ArcField<T::Value>where
AtKeyed<Inner, Prev, K, T>: Clone,
K: Clone + Debug + Send + Sync + PartialEq + Eq + Hash + 'static,
KeyedSubfield<Inner, Prev, K, T>: Clone,
T: KeyedIterable + KeyedAccess<K> + 'static,
for<'a> &'a T: IntoIterator<Item = <T as KeyedIterable>::IterItem<'a>>,
Inner: StoreField<Value = Prev> + IsDisposed + Send + Sync + 'static,
Prev: 'static,
T::Value: Sized,
Source§impl<Inner, T> From<DerefedField<Inner>> for ArcField<T>where
Inner: Clone + StoreField + IsDisposed + Send + Sync + 'static,
Inner::Value: Deref<Target = T> + DerefMut,
T: Sized + 'static,
impl<Inner, T> From<DerefedField<Inner>> for ArcField<T>where
Inner: Clone + StoreField + IsDisposed + Send + Sync + 'static,
Inner::Value: Deref<Target = T> + DerefMut,
T: Sized + 'static,
Source§fn from(value: DerefedField<Inner>) -> Self
fn from(value: DerefedField<Inner>) -> Self
Converts to this type from the input type.
Source§impl<Inner, Prev, T> From<Subfield<Inner, Prev, T>> for ArcField<T>where
T: Send + Sync,
Subfield<Inner, Prev, T>: Clone,
Inner: StoreField<Value = Prev> + IsDisposed + Send + Sync + 'static,
Prev: 'static,
impl<Inner, Prev, T> From<Subfield<Inner, Prev, T>> for ArcField<T>where
T: Send + Sync,
Subfield<Inner, Prev, T>: Clone,
Inner: StoreField<Value = Prev> + IsDisposed + Send + Sync + 'static,
Prev: 'static,
Source§impl<T> IsDisposed for ArcField<T>
impl<T> IsDisposed for ArcField<T>
Source§fn is_disposed(&self) -> bool
fn is_disposed(&self) -> bool
If
true, the signal cannot be accessed without a panic.Source§impl<T> ReadUntracked for ArcField<T>
impl<T> ReadUntracked for ArcField<T>
Source§type Value = StoreFieldReader<T>
type Value = StoreFieldReader<T>
The guard type that will be returned, which can be dereferenced to the value.
Source§fn try_read_untracked(&self) -> Option<Self::Value>
fn try_read_untracked(&self) -> Option<Self::Value>
Returns the guard, or
None if the signal has already been disposed.Source§fn read_untracked(&self) -> Self::Value
fn read_untracked(&self) -> Self::Value
Returns the guard. Read more
Source§fn custom_try_read(&self) -> Option<Option<Self::Value>>
fn custom_try_read(&self) -> Option<Option<Self::Value>>
This is a backdoor to allow overriding the
Read::try_read implementation despite it being auto implemented. Read moreSource§impl<V> SignalOrFn for ArcField<V>
impl<V> SignalOrFn for ArcField<V>
Source§impl<T> StoreField for ArcField<T>
impl<T> StoreField for ArcField<T>
Source§fn get_trigger(&self, path: StorePath) -> StoreFieldTrigger
fn get_trigger(&self, path: StorePath) -> StoreFieldTrigger
Returns the trigger that tracks access and updates for this field.
Source§fn get_trigger_unkeyed(&self, path: StorePath) -> StoreFieldTrigger
fn get_trigger_unkeyed(&self, path: StorePath) -> StoreFieldTrigger
Returns the trigger that tracks access and updates for this field. Read more
Source§fn path(&self) -> impl IntoIterator<Item = StorePathSegment>
fn path(&self) -> impl IntoIterator<Item = StorePathSegment>
The path of this field (see
StorePath).Source§fn path_unkeyed(&self) -> impl IntoIterator<Item = StorePathSegment>
fn path_unkeyed(&self) -> impl IntoIterator<Item = StorePathSegment>
The path of this field (see
StorePath). Uses unkeyed indices for any keyed fields.Source§fn track_field(&self)
fn track_field(&self)
Reactively tracks this field.
Source§fn triggers_for_current_path(&self) -> Vec<ArcTrigger>
fn triggers_for_current_path(&self) -> Vec<ArcTrigger>
Returns triggers for this field, and all parent fields.
Source§fn triggers_for_path(&self, path: StorePath) -> Vec<ArcTrigger>
fn triggers_for_path(&self, path: StorePath) -> Vec<ArcTrigger>
Returns triggers for the field at the given path, and all parent fields
Source§fn triggers_for_path_unkeyed(&self, path: StorePath) -> Vec<ArcTrigger>
fn triggers_for_path_unkeyed(&self, path: StorePath) -> Vec<ArcTrigger>
Returns triggers for the field at the given path, and all parent fields
Source§impl<T> Write for ArcField<T>
impl<T> Write for ArcField<T>
Source§fn try_write(&self) -> Option<impl UntrackableGuard<Target = Self::Value>>
fn try_write(&self) -> Option<impl UntrackableGuard<Target = Self::Value>>
Returns the guard, or
None if the signal has already been disposed.Source§fn try_write_untracked(&self) -> Option<impl DerefMut<Target = Self::Value>>
fn try_write_untracked(&self) -> Option<impl DerefMut<Target = Self::Value>>
or
None if the signal has already been disposed.Source§fn write(&self) -> impl UntrackableGuard
fn write(&self) -> impl UntrackableGuard
Returns the guard. Read more
Source§fn write_untracked(&self) -> impl DerefMut
fn write_untracked(&self) -> impl DerefMut
Returns a guard that will not notify subscribers when dropped. Read more
Auto Trait Implementations§
impl<T> !RefUnwindSafe for ArcField<T>
impl<T> !UnwindSafe for ArcField<T>
impl<T> Freeze for ArcField<T>
impl<T> Send for ArcField<T>
impl<T> Sync for ArcField<T>
impl<T> Unpin for ArcField<T>
impl<T> UnsafeUnpin for ArcField<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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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<T> Read for Twhere
T: Track + ReadUntracked,
impl<T> Read for Twhere
T: Track + ReadUntracked,
Source§impl<T> Set for Twhere
T: Update + IsDisposed,
impl<T> Set for Twhere
T: Update + IsDisposed,
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.
Source§impl<Inner, Prev> StoreFieldIterator<Prev> for Inner
impl<Inner, Prev> StoreFieldIterator<Prev> for Inner
Source§fn at_unkeyed(self, index: usize) -> AtIndex<Inner, Prev>
fn at_unkeyed(self, index: usize) -> AtIndex<Inner, Prev>
Reactive access to the value at some index.
Source§fn iter_unkeyed(self) -> StoreFieldIter<Inner, Prev> ⓘ
fn iter_unkeyed(self) -> StoreFieldIter<Inner, Prev> ⓘ
An iterator over the values in the collection.
Source§impl<T> Update for Twhere
T: Write,
impl<T> Update for Twhere
T: Write,
Source§fn try_maybe_update<U>(
&self,
fun: impl FnOnce(&mut <T as Update>::Value) -> (bool, U),
) -> Option<U>
fn try_maybe_update<U>( &self, fun: impl FnOnce(&mut <T as Update>::Value) -> (bool, U), ) -> Option<U>
Updates the value of the signal, notifying subscribers if the update function returns
(true, _), and returns the value returned by the update function,
or None if the signal has already been disposed.Source§fn update(&self, fun: impl FnOnce(&mut Self::Value))
fn update(&self, fun: impl FnOnce(&mut Self::Value))
Updates the value of the signal and notifies subscribers.
Source§impl<T> UpdateUntracked for Twhere
T: Write,
impl<T> UpdateUntracked for Twhere
T: Write,
Source§fn try_update_untracked<U>(
&self,
fun: impl FnOnce(&mut <T as UpdateUntracked>::Value) -> U,
) -> Option<U>
fn try_update_untracked<U>( &self, fun: impl FnOnce(&mut <T as UpdateUntracked>::Value) -> U, ) -> Option<U>
Updates the value by applying a function, returning the value returned by that function,
or
None if the signal has already been disposed.
Does not notify subscribers that the signal has changed.Source§impl<T> With for Twhere
T: Read,
impl<T> With for Twhere
T: Read,
Source§type Value = <<T as Read>::Value as Deref>::Target
type Value = <<T as Read>::Value as Deref>::Target
The type of the value contained in the signal.
Source§impl<T> WithUntracked for Twhere
T: DefinedAt + ReadUntracked,
impl<T> WithUntracked for Twhere
T: DefinedAt + ReadUntracked,
Source§type Value = <<T as ReadUntracked>::Value as Deref>::Target
type Value = <<T as ReadUntracked>::Value as Deref>::Target
The type of the value contained in the signal.
Source§fn try_with_untracked<U>(
&self,
fun: impl FnOnce(&<T as WithUntracked>::Value) -> U,
) -> Option<U>
fn try_with_untracked<U>( &self, fun: impl FnOnce(&<T as WithUntracked>::Value) -> U, ) -> Option<U>
Applies the closure to the value, and returns the result,
or
None if the signal has already been disposed.