Trait loro_internal::handler::HandlerTrait
source · pub trait HandlerTrait: Clone + Sized {
Show 13 methods
// Required methods
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>;
fn attach(
&self,
txn: &mut Transaction,
parent: &BasicHandler,
self_id: ContainerID,
) -> LoroResult<Self>;
fn get_attached(&self) -> Option<Self>;
// Provided methods
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> { ... }
}
Required Methods§
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>
sourcefn 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.
sourcefn 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.
Provided Methods§
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>
Object Safety§
This trait is not object safe.