Struct loro_internal::DocState
source · pub struct DocState { /* private fields */ }
Implementations§
source§impl DocState
impl DocState
pub fn new(arena: SharedArena) -> 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<()>
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
Trait Implementations§
Auto Trait Implementations§
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