pub struct ListEntry<T>(/* private fields */);Expand description
A pointer to an element from a List
Note that this cannot be used directly to get access to the value in the list. Instead, one
must use either one of the methods use_w or use_rw.
ListEntry implements PartialEq AS A POINTER ONLY. This is so that the properties of a
component depend only on which list entry is referenced, and not on the value.
Implementations§
Source§impl<T> ListEntry<T>
impl<T> ListEntry<T>
Sourcepub fn use_w<'a, P>(&self, cx: &Scope<'a, P>) -> &'a mut Shared<T, W>
pub fn use_w<'a, P>(&self, cx: &Scope<'a, P>) -> &'a mut Shared<T, W>
Get a write pointer to the element as a hook.
This is the expected way to get write-only access to an entry when it is passed down from a
parent component. If you need to access an entry in the component which owns the list it
belongs to, then you generally need to use share instead.
Sourcepub fn use_rw<'a, P>(&self, cx: &Scope<'a, P>) -> &'a mut Shared<T, RW>
pub fn use_rw<'a, P>(&self, cx: &Scope<'a, P>) -> &'a mut Shared<T, RW>
Get a read-write pointer to the element.
Scope cx will be registered as needing update every time the referenced value changes.
This is the expected ways to get read/write access an entry when it is passed down from a
parent component. If you need to access an entry in the component which owns the list it
belongs to, then you generally need to use share instead.