Struct loro_internal::DocState
source · pub struct DocState { /* private fields */ }
Implementations§
source§impl DocState
impl DocState
pub fn new_arc( arena: SharedArena, global_txn: Weak<Mutex<Option<Transaction>>>, config: Configure ) -> Arc<Mutex<Self>>
pub fn start_recording(&mut self)
pub fn stop_and_clear_recording(&mut self)
pub fn is_recording(&self) -> bool
pub fn refresh_peer_id(&mut self)
sourcepub fn take_events(&mut self) -> Vec<DocDiff>
pub fn take_events(&mut self) -> Vec<DocDiff>
Take all the diffs that are recorded and convert them to events.
sourcepub fn set_peer_id(&mut self, peer: PeerID)
pub fn set_peer_id(&mut self, peer: PeerID)
Change the peer id of this doc state. It changes the peer id for the future txn on this AppState
pub fn peer_id(&self) -> PeerID
pub fn apply_local_op(&mut self, raw_op: &RawOp<'_>, op: &Op) -> LoroResult<()>
pub fn iter(&self) -> impl Iterator<Item = &State>
pub fn iter_mut(&mut self) -> impl Iterator<Item = &mut State>
sourcepub fn get_text<I: Into<ContainerIdRaw>>(
&mut self,
id: I
) -> Option<&mut RichtextState>
pub fn get_text<I: Into<ContainerIdRaw>>( &mut self, id: I ) -> Option<&mut RichtextState>
id can be a str, ContainerID, or ContainerIdRaw. if it’s str it will use Root container, which will not be None
pub fn is_empty(&self) -> bool
pub fn get_deep_value(&mut self) -> LoroValue
pub fn get_deep_value_with_id(&mut self) -> LoroValue
pub fn get_container_deep_value(&mut self, container: ContainerIdx) -> LoroValue
pub fn log_estimated_size(&self)
pub fn create_state(&self, idx: ContainerIdx) -> State
pub fn get_relative_position(&mut self, pos: &Cursor) -> Option<usize>
pub fn get_value_by_path(&mut self, path: &[Index]) -> Option<LoroValue>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DocState
impl RefUnwindSafe for DocState
impl Send for DocState
impl Sync for DocState
impl Unpin for DocState
impl UnwindSafe for DocState
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