pub struct SharedArena { /* private fields */ }
Expand description

This is shared between [OpLog] and [AppState].

Implementations§

source§

impl SharedArena

source

pub fn register_container(&self, id: &ContainerID) -> ContainerIdx

source

pub fn get_container_id(&self, idx: ContainerIdx) -> Option<ContainerID>

source

pub fn id_to_idx(&self, id: &ContainerID) -> Option<ContainerIdx>

source

pub fn idx_to_id(&self, id: ContainerIdx) -> Option<ContainerID>

source

pub fn with_idx_to_id<R>(&self, f: impl FnOnce(&Vec<ContainerID>) -> R) -> R

source

pub fn alloc_str(&self, str: &str) -> StrAllocResult

source

pub fn alloc_str_with_slice(&self, str: &str) -> (BytesSlice, usize)

return slice and unicode index

source

pub fn alloc_str_fast(&self, bytes: &[u8])

alloc str without extra info

source

pub fn utf16_len(&self) -> usize

source

pub fn alloc_value(&self, value: LoroValue) -> usize

source

pub fn alloc_values( &self, values: impl Iterator<Item = LoroValue> ) -> Range<usize>

source

pub fn set_parent(&self, child: ContainerIdx, parent: Option<ContainerIdx>)

source

pub fn log_hierarchy(&self)

source

pub fn get_parent(&self, child: ContainerIdx) -> Option<ContainerIdx>

source

pub fn with_ancestors( &self, container: ContainerIdx, f: impl FnMut(ContainerIdx, bool) )

Call f on each ancestor of container, including container itself.

f(ContainerIdx, is_first)

source

pub fn slice_by_unicode(&self, range: impl RangeBounds<usize>) -> BytesSlice

source

pub fn slice_by_utf8(&self, range: impl RangeBounds<usize>) -> BytesSlice

source

pub fn slice_str_by_unicode_range(&self, range: Range<usize>) -> String

source

pub fn with_text_slice(&self, range: Range<usize>, f: impl FnMut(&str))

source

pub fn get_value(&self, idx: usize) -> Option<LoroValue>

source

pub fn get_values(&self, range: Range<usize>) -> Vec<LoroValue>

source

pub fn convert_single_op( &self, container: &ContainerID, peer: PeerID, counter: Counter, lamport: Lamport, content: RawOpContent<'_> ) -> Op

source

pub fn can_import_snapshot(&self) -> bool

source

pub fn convert_raw_op(&self, op: &RawOp<'_>) -> Op

source

pub fn export_containers(&self) -> Vec<ContainerID>

source

pub fn export_parents(&self) -> Vec<Option<ContainerIdx>>

source

pub fn root_containers(&self) -> Vec<ContainerIdx>

Trait Implementations§

source§

impl Clone for SharedArena

source§

fn clone(&self) -> SharedArena

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SharedArena

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for SharedArena

source§

fn default() -> SharedArena

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> ZeroElement for Twhere T: Default,