pub struct ReactiveList<T: Clone + Send + Sync + 'static> {
pub node_id: NodeId,
/* private fields */
}Expand description
Reactive ordered list.
Emits Vec<T> snapshots via a Core state node on every mutation.
Fields§
§node_id: NodeIdImplementations§
Source§impl<T: Clone + Send + Sync + 'static> ReactiveList<T>
impl<T: Clone + Send + Sync + 'static> ReactiveList<T>
pub fn new( core: &Core, intern: InternFn<Vec<T>>, opts: ReactiveListOptions<T>, ) -> Self
pub fn size(&self) -> usize
pub fn at(&self, index: i64) -> Option<T>
pub fn append(&self, core: &Core, value: T)
pub fn append_many(&self, core: &Core, values: Vec<T>)
Sourcepub fn insert(
&self,
core: &Core,
index: usize,
value: T,
) -> Result<(), IndexOutOfBounds>
pub fn insert( &self, core: &Core, index: usize, value: T, ) -> Result<(), IndexOutOfBounds>
Insert value at index. Returns Err(IndexOutOfBounds) if
index > self.size().
Sourcepub fn insert_many(
&self,
core: &Core,
index: usize,
values: Vec<T>,
) -> Result<(), IndexOutOfBounds>
pub fn insert_many( &self, core: &Core, index: usize, values: Vec<T>, ) -> Result<(), IndexOutOfBounds>
Insert values starting at index. Returns Err(IndexOutOfBounds) if
index > self.size().
Sourcepub fn pop(&self, core: &Core, index: i64) -> Option<T>
pub fn pop(&self, core: &Core, index: i64) -> Option<T>
Remove and return element at index. Negative indices count from end.
Returns None if index is out of range.
pub fn clear(&self, core: &Core)
pub fn to_vec(&self) -> Vec<T>
pub fn mutation_log_snapshot(&self) -> Option<Vec<BaseChange<ListChange<T>>>>
Auto Trait Implementations§
impl<T> !Freeze for ReactiveList<T>
impl<T> !RefUnwindSafe for ReactiveList<T>
impl<T> Send for ReactiveList<T>
impl<T> Sync for ReactiveList<T>
impl<T> Unpin for ReactiveList<T>where
T: Unpin,
impl<T> UnsafeUnpin for ReactiveList<T>
impl<T> !UnwindSafe for ReactiveList<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