Struct loro_internal::handler::ListHandler
source · pub struct ListHandler { /* private fields */ }
Implementations§
source§impl ListHandler
impl ListHandler
sourcepub fn new_detached() -> Self
pub fn new_detached() -> Self
Create a new container that is detached from the document. The edits on a detached container will not be persisted. To attach the container to the document, please insert it into an attached container.
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<H: HandlerTrait>( &self, pos: usize, child: H ) -> LoroResult<H>
pub fn insert_container_with_txn<H: HandlerTrait>( &self, txn: &mut Transaction, pos: usize, child: H ) -> LoroResult<H>
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) -> LoroResult<Handler>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn get_deep_value_with_id(&self) -> LoroResult<LoroValue>
pub fn get(&self, index: usize) -> Option<LoroValue>
sourcepub fn get_(&self, index: usize) -> Option<ValueOrHandler>
pub fn get_(&self, index: usize) -> Option<ValueOrHandler>
Get value at given index, if it’s a container, return a handler to the container
pub fn for_each<I>(&self, f: I)
pub fn get_cursor(&self, pos: usize, side: Side) -> Option<Cursor>
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 moresource§impl Debug for ListHandler
impl Debug for ListHandler
source§impl HandlerTrait for ListHandler
impl HandlerTrait for ListHandler
fn is_attached(&self) -> bool
fn attached_handler(&self) -> Option<&BasicHandler>
fn get_value(&self) -> LoroValue
fn get_deep_value(&self) -> LoroValue
fn kind(&self) -> ContainerType
fn to_handler(&self) -> Handler
source§fn attach(
&self,
txn: &mut Transaction,
parent: &BasicHandler,
self_id: ContainerID
) -> LoroResult<Self>
fn attach( &self, txn: &mut Transaction, parent: &BasicHandler, self_id: ContainerID ) -> LoroResult<Self>
This method returns an attached handler.
source§fn get_attached(&self) -> Option<Self>
fn get_attached(&self) -> Option<Self>
If a detached container is attached, this method will return its corresponding attached handler.
fn from_handler(h: Handler) -> Option<Self>
fn parent(&self) -> Option<Handler>
fn idx(&self) -> ContainerIdx
fn id(&self) -> ContainerID
fn with_state<R>( &self, f: impl FnOnce(&mut State) -> LoroResult<R> ) -> LoroResult<R>
Auto Trait Implementations§
impl Freeze for ListHandler
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