Skip to main content

Crate loro_common

Crate loro_common 

Source

Macros§

debug
error
info
loro_value
A macro for creating LoroValue. It works just like the json! macro in serde_json.
trace
warn

Structs§

CompactId
It’s the unique ID of an Op represented by PeerID and Counter.
CompactIdLp
It’s the unique ID of an Op represented by PeerID and Counter.
CounterSpan
This struct supports reverse repr: from can be less than to. We need this because it’ll make merging deletions easier.
ID
It’s the unique ID of an Op represented by PeerID and Counter.
IdFull
It’s the unique ID of an Op represented by PeerID, Lamport clock 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.
IdLpSpan
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.
InternalString
LamportSpan
LoroBinaryValue
LoroListValue
LoroMapValue
LoroStringValue
TreeID
Each node of movable tree has a unique TreeID generated by Loro.

Enums§

ContainerID
ContainerID includes the Op’s ID and the type. So it’s impossible to have the same ContainerID with conflict ContainerType.
ContainerType
LoroEncodeError
LoroError
LoroTreeError
LoroValue
LoroValue is used to represents the state of CRDT at a given version.

Constants§

DELETED_TREE_ROOT
In movable tree, we use a specific TreeID to represent the root of ALL deleted tree node.
MERGEABLE_MARKER_MAGIC
Binary marker stored in a parent map slot to activate a mergeable child.
MERGEABLE_NAMESPACE_PREFIX
Namespace prefix used to encode mergeable container IDs into Root container names.

Traits§

HasCounter
HasCounterSpan
HasId
HasIdSpan
HasLamport
HasLamportSpan

Functions§

check_root_container_name
Return whether the given name is a valid root container name.
mergeable_marker
Build the LoroValue a parent map stores at a mergeable key for container_type.
parse_mergeable_marker
Parse a parent map slot value back into the mergeable ContainerType it activates.
to_value
translate_mergeable_marker_value
Translate a raw map slot value into the user-visible Container view for a Map at parent.

Type Aliases§

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