Skip to main content

ReactiveList

Struct ReactiveList 

Source
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: NodeId

Implementations§

Source§

impl<T: Clone + Send + Sync + 'static> ReactiveList<T>

Source

pub fn new( core: &Core, intern: InternFn<Vec<T>>, opts: ReactiveListOptions<T>, ) -> Self

Source

pub fn size(&self) -> usize

Source

pub fn at(&self, index: i64) -> Option<T>

Source

pub fn append(&self, value: T)

Source

pub fn append_many(&self, values: Vec<T>)

Source

pub fn insert(&self, index: usize, value: T) -> Result<(), IndexOutOfBounds>

Insert value at index. Returns Err(IndexOutOfBounds) if index > self.size().

Source

pub fn insert_many( &self, index: usize, values: Vec<T>, ) -> Result<(), IndexOutOfBounds>

Insert values starting at index. Returns Err(IndexOutOfBounds) if index > self.size().

Source

pub fn pop(&self, index: i64) -> Option<T>

Remove and return element at index. Negative indices count from end. Returns None if index is out of range.

Source

pub fn clear(&self)

Source

pub fn to_vec(&self) -> Vec<T>

Source

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.