Crate loro_internal

Source
Expand description

loro-internal is a CRDT framework.

Re-exports§

pub use event::ContainerDiff;
pub use event::DiffEvent;
pub use event::DocDiff;
pub use event::ListDiff;
pub use event::ListDiffInsertItem;
pub use event::ListDiffItem;
pub use handler::BasicHandler;
pub use handler::HandlerTrait;
pub use handler::ListHandler;
pub use handler::MapHandler;
pub use handler::MovableListHandler;
pub use handler::TextHandler;
pub use handler::TreeHandler;
pub use handler::UnknownHandler;
pub use oplog::OpLog;
pub use undo::UndoManager;
pub use version::VersionVector;
pub use loro_common;
pub use loro_delta;

Modules§

allocation
arena
awareness
change
Changes are merged ops.
configure
container
CRDT [Container]. Each container may have different CRDT type ContainerType. Each [Op] has an associated container. It’s the [Container]’s responsibility to calculate the state from the [Op]s.
cursor
dag
DAG (Directed Acyclic Graph) is a common data structure in distributed system.
delta
diff
diff_calc
encoding
estimated_size
event
handler
id
json
kv_store
loro
op
oplog
pre_commit
subscription
sync
txn
undo
version

Macros§

array_mut_ref
fx_map
loro_value
A macro for creating LoroValue. It works just like the json! macro in serde_json.
version_range
vv

Structs§

ChangeMeta
Change is a grouped continuous operations that share the same id, timestamp, commit message.
CounterSpan
This struct supports reverse repr: from can be less than to. We need this because it’ll make merging deletions easier.
DocState
FractionalIndex
ID
It’s the unique ID of an Op represented by PeerID and Counter.
IdLp
It’s the unique ID of an Op represented by PeerID and Lamport clock. It’s used to define the total order of Ops.
IdSpan
This struct supports reverse repr: CounterSpan’s from can be less than to. But we should use it conservatively. We need this because it’ll make merging deletions easier.
LoroBinaryValue
LoroDoc
LoroDoc serves as the library’s primary entry point. It’s constituted by an OpLog and an DocState.
LoroDocInner
LoroListValue
LoroMapValue
LoroStringValue
StringSlice
Subscription
A handle to a subscription created by GPUI. When dropped, the subscription is cancelled and the callback will no longer be invoked.
TreeID
Each node of movable tree has a unique TreeID generated by Loro.
TreeNode
TreeNodeWithChildren

Enums§

ContainerType
LoroEncodeError
LoroError
LoroTreeError
LoroValue
LoroValue is used to represents the state of CRDT at a given version.
TreeParentId

Constants§

LORO_VERSION
The version of the loro crate

Traits§

ApplyDiff
ToJson

Functions§

to_value

Type Aliases§

Counter
If it’s the nth Op of a peer, the counter will be n.
FxHashMap
A HashMap using a default Fx hasher.
IdSpanVector
Lamport
It’s the Lamport clock
LoroResult
PeerID
Unique id for each peer. It’s a random u64 by default.