Struct loro_internal::handler::ListHandler
source · pub struct ListHandler { /* private fields */ }
Implementations§
source§impl ListHandler
impl ListHandler
pub fn new( txn: Weak<Mutex<Option<Transaction>>>, idx: ContainerIdx, state: Weak<Mutex<DocState>> ) -> Self
pub fn insert(&self, pos: usize, v: impl Into<LoroValue>) -> LoroResult<()>
pub fn insert_with_txn( &self, txn: &mut Transaction, pos: usize, v: LoroValue ) -> LoroResult<()>
pub fn push(&self, v: LoroValue) -> LoroResult<()>
pub fn push_with_txn( &self, txn: &mut Transaction, v: LoroValue ) -> LoroResult<()>
pub fn pop(&self) -> LoroResult<Option<LoroValue>>
pub fn pop_with_txn( &self, txn: &mut Transaction ) -> LoroResult<Option<LoroValue>>
pub fn insert_container( &self, pos: usize, c_type: ContainerType ) -> LoroResult<Handler>
pub fn insert_container_with_txn( &self, txn: &mut Transaction, pos: usize, c_type: ContainerType ) -> LoroResult<Handler>
pub fn delete(&self, pos: usize, len: usize) -> LoroResult<()>
pub fn delete_with_txn( &self, txn: &mut Transaction, pos: usize, len: usize ) -> LoroResult<()>
pub fn get_child_handler(&self, index: usize) -> Handler
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn get_value(&self) -> LoroValue
pub fn get_deep_value(&self) -> LoroValue
pub fn get_deep_value_with_id(&self) -> LoroValue
pub fn id(&self) -> ContainerID
pub fn get(&self, index: usize) -> Option<LoroValue>
sourcepub fn get_(&self, index: usize) -> Option<ValueOrContainer>
pub fn get_(&self, index: usize) -> Option<ValueOrContainer>
Get value at given index, if it’s a container, return a handler to the container
pub fn for_each<I>(&self, f: I)where I: FnMut(ValueOrContainer),
Trait Implementations§
source§impl Clone for ListHandler
impl Clone for ListHandler
source§fn clone(&self) -> ListHandler
fn clone(&self) -> ListHandler
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl RefUnwindSafe for ListHandler
impl Send for ListHandler
impl Sync for ListHandler
impl Unpin for ListHandler
impl UnwindSafe for ListHandler
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