Struct loro_internal::handler::MovableListHandler
source · pub struct MovableListHandler { /* private fields */ }
Implementations§
source§impl MovableListHandler
impl MovableListHandler
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 mov(&self, from: usize, to: usize) -> LoroResult<()>
sourcepub fn move_with_txn(
&self,
txn: &mut Transaction,
from: usize,
to: usize
) -> LoroResult<()>
pub fn move_with_txn( &self, txn: &mut Transaction, from: usize, to: usize ) -> LoroResult<()>
Move element from from
to to
. After this op, elem will be at pos to
.
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<ValueOrHandler>>
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 set(&self, index: usize, value: impl Into<LoroValue>) -> LoroResult<()>
pub fn set_with_txn( &self, txn: &mut Transaction, index: usize, value: LoroValue ) -> LoroResult<()>
pub fn set_container<H: HandlerTrait>( &self, pos: usize, child: H ) -> LoroResult<H>
pub fn set_container_with_txn<H: HandlerTrait>( &self, txn: &mut Transaction, pos: usize, child: H ) -> Result<H, LoroError>
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) -> 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)where
I: FnMut(ValueOrHandler),
pub fn log_internal_state(&self) -> String
pub fn new_detached() -> MovableListHandler
pub fn get_cursor(&self, pos: usize, side: Side) -> Option<Cursor>
Trait Implementations§
source§impl Clone for MovableListHandler
impl Clone for MovableListHandler
source§fn clone(&self) -> MovableListHandler
fn clone(&self) -> MovableListHandler
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 MovableListHandler
impl Debug for MovableListHandler
source§impl HandlerTrait for MovableListHandler
impl HandlerTrait for MovableListHandler
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
fn from_handler(h: Handler) -> Option<Self>
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 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 MovableListHandler
impl RefUnwindSafe for MovableListHandler
impl Send for MovableListHandler
impl Sync for MovableListHandler
impl Unpin for MovableListHandler
impl UnwindSafe for MovableListHandler
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