loro

package module
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 14, 2026 License: MIT Imports: 14 Imported by: 0

README

loro-go

This repository contains Loro CRDT bindings for Go. Contains pre-built binaries for MacOS (ARM64, AMD64) and Linux (ARM64, AMD64).

⚠️ There is currently very little extra plumbing to make the bindings easier to use. I'm updating it as I need it.

Current Loro version: 1.12.0

Updating the Loro version

Ensure you use --recursive when you git clone this repository to pull in the loro-ffi submodule.

./scripts/updateLoro.sh 1.x.x

You can get the version number from the loro-ffi tags page.

This updates the loro-ffi submodule, loro-go/Cargo.toml, and the lockfile. Open a PR with the changes and CI will build the libraries and commit them after merge.

Usage

go get github.com/aholstenson/loro-go

When building your binary you will likely want statically linking to avoid a dependency on libgcc:

go build -ldflags '-linkmode external -extldflags "-static"'

Examples

Getting started
doc := loro.NewLoroDoc()

loroMap := doc.GetMap(loro.AsContainerId("test"))
loroMap.Insert("test", loro.AsStringValue("test"))
Exporting updates
updates, err := doc.ExportUpdates(loro.NewVersionVector())
Importing updates
status, err := doc.Import(updates)

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCannotFindRelativePositionContainerDeleted = fmt.Errorf("CannotFindRelativePositionContainerDeleted")

Err* are used for checking error type with `errors.Is`

View Source
var ErrCannotFindRelativePositionHistoryCleared = fmt.Errorf("CannotFindRelativePositionHistoryCleared")
View Source
var ErrCannotFindRelativePositionIdNotFound = fmt.Errorf("CannotFindRelativePositionIdNotFound")
View Source
var ErrChangeTravelErrorTargetIdNotFound = fmt.Errorf("ChangeTravelErrorTargetIdNotFound")

Err* are used for checking error type with `errors.Is`

View Source
var ErrChangeTravelErrorTargetVersionNotIncluded = fmt.Errorf("ChangeTravelErrorTargetVersionNotIncluded")
View Source
var ErrJsonPathErrorEvaluationError = fmt.Errorf("JsonPathErrorEvaluationError")
View Source
var ErrJsonPathErrorInvalidJsonPath = fmt.Errorf("JsonPathErrorInvalidJsonPath")

Err* are used for checking error type with `errors.Is`

View Source
var ErrLoroEncodeErrorFrontiersNotFound = fmt.Errorf("LoroEncodeErrorFrontiersNotFound")

Err* are used for checking error type with `errors.Is`

View Source
var ErrLoroEncodeErrorShallowSnapshotIncompatibleWithOldFormat = fmt.Errorf("LoroEncodeErrorShallowSnapshotIncompatibleWithOldFormat")
View Source
var ErrLoroEncodeErrorUnknownContainer = fmt.Errorf("LoroEncodeErrorUnknownContainer")
View Source
var ErrLoroErrorArgErr = fmt.Errorf("LoroErrorArgErr")
View Source
var ErrLoroErrorAutoCommitNotStarted = fmt.Errorf("LoroErrorAutoCommitNotStarted")
View Source
var ErrLoroErrorConcurrentOpsWithSamePeerId = fmt.Errorf("LoroErrorConcurrentOpsWithSamePeerId")
View Source
var ErrLoroErrorContainerDeleted = fmt.Errorf("LoroErrorContainerDeleted")
View Source
var ErrLoroErrorContainersNotFound = fmt.Errorf("LoroErrorContainersNotFound")
View Source
var ErrLoroErrorDecodeChecksumMismatchError = fmt.Errorf("LoroErrorDecodeChecksumMismatchError")
View Source
var ErrLoroErrorDecodeDataCorruptionError = fmt.Errorf("LoroErrorDecodeDataCorruptionError")
View Source
var ErrLoroErrorDecodeError = fmt.Errorf("LoroErrorDecodeError")
View Source
var ErrLoroErrorDecodeVersionVectorError = fmt.Errorf("LoroErrorDecodeVersionVectorError")
View Source
var ErrLoroErrorDuplicatedTransactionError = fmt.Errorf("LoroErrorDuplicatedTransactionError")
View Source
var ErrLoroErrorEditWhenDetached = fmt.Errorf("LoroErrorEditWhenDetached")
View Source
var ErrLoroErrorEndIndexLessThanStartIndex = fmt.Errorf("LoroErrorEndIndexLessThanStartIndex")
View Source
var ErrLoroErrorFrontiersNotFound = fmt.Errorf("LoroErrorFrontiersNotFound")
View Source
var ErrLoroErrorImportUnsupportedEncodingMode = fmt.Errorf("LoroErrorImportUnsupportedEncodingMode")
View Source
var ErrLoroErrorImportUpdatesThatDependsOnOutdatedVersion = fmt.Errorf("LoroErrorImportUpdatesThatDependsOnOutdatedVersion")
View Source
var ErrLoroErrorImportWhenInTxn = fmt.Errorf("LoroErrorImportWhenInTxn")
View Source
var ErrLoroErrorIncompatibleFutureEncodingError = fmt.Errorf("LoroErrorIncompatibleFutureEncodingError")
View Source
var ErrLoroErrorInvalidJsonSchema = fmt.Errorf("LoroErrorInvalidJsonSchema")
View Source
var ErrLoroErrorInvalidPeerId = fmt.Errorf("LoroErrorInvalidPeerId")
View Source
var ErrLoroErrorInvalidRootContainerName = fmt.Errorf("LoroErrorInvalidRootContainerName")
View Source
var ErrLoroErrorJsError = fmt.Errorf("LoroErrorJsError")
View Source
var ErrLoroErrorLockError = fmt.Errorf("LoroErrorLockError")
View Source
var ErrLoroErrorMisuseDetachedContainer = fmt.Errorf("LoroErrorMisuseDetachedContainer")
View Source
var ErrLoroErrorNotFoundError = fmt.Errorf("LoroErrorNotFoundError")
View Source
var ErrLoroErrorNotImplemented = fmt.Errorf("LoroErrorNotImplemented")
View Source
var ErrLoroErrorOutOfBound = fmt.Errorf("LoroErrorOutOfBound")
View Source
var ErrLoroErrorReattachAttachedContainer = fmt.Errorf("LoroErrorReattachAttachedContainer")
View Source
var ErrLoroErrorStyleConfigMissing = fmt.Errorf("LoroErrorStyleConfigMissing")
View Source
var ErrLoroErrorSwitchToVersionBeforeShallowRoot = fmt.Errorf("LoroErrorSwitchToVersionBeforeShallowRoot")
View Source
var ErrLoroErrorTransactionError = fmt.Errorf("LoroErrorTransactionError")
View Source
var ErrLoroErrorTreeError = fmt.Errorf("LoroErrorTreeError")
View Source
var ErrLoroErrorUndoGroupAlreadyStarted = fmt.Errorf("LoroErrorUndoGroupAlreadyStarted")
View Source
var ErrLoroErrorUndoInvalidIdSpan = fmt.Errorf("LoroErrorUndoInvalidIdSpan")
View Source
var ErrLoroErrorUndoWithDifferentPeerId = fmt.Errorf("LoroErrorUndoWithDifferentPeerId")
View Source
var ErrLoroErrorUnknown = fmt.Errorf("LoroErrorUnknown")
View Source
var ErrLoroErrorUnmatchedContext = fmt.Errorf("LoroErrorUnmatchedContext")

Err* are used for checking error type with `errors.Is`

View Source
var ErrLoroErrorUsedOpId = fmt.Errorf("LoroErrorUsedOpId")
View Source
var ErrLoroErrorUtf16InUnicodeCodePoint = fmt.Errorf("LoroErrorUtf16InUnicodeCodePoint")
View Source
var ErrLoroErrorUtf8InUnicodeCodePoint = fmt.Errorf("LoroErrorUtf8InUnicodeCodePoint")
View Source
var ErrUpdateTimeoutErrorTimeout = fmt.Errorf("UpdateTimeoutErrorTimeout")

Err* are used for checking error type with `errors.Is`

View Source
var FfiConverterAbsolutePositionINSTANCE = FfiConverterAbsolutePosition{}
View Source
var FfiConverterAwarenessINSTANCE = FfiConverterAwareness{}
View Source
var FfiConverterAwarenessPeerUpdateINSTANCE = FfiConverterAwarenessPeerUpdate{}
View Source
var FfiConverterBoolINSTANCE = FfiConverterBool{}
View Source
var FfiConverterBytesINSTANCE = FfiConverterBytes{}
View Source
var FfiConverterCannotFindRelativePositionINSTANCE = FfiConverterCannotFindRelativePosition{}
View Source
var FfiConverterChangeAncestorsTravelerINSTANCE = FfiConverterChangeAncestorsTraveler{
	// contains filtered or unexported fields
}
View Source
var FfiConverterChangeMetaINSTANCE = FfiConverterChangeMeta{}
View Source
var FfiConverterChangeModifierINSTANCE = FfiConverterChangeModifier{}
View Source
var FfiConverterChangeTravelErrorINSTANCE = FfiConverterChangeTravelError{}
View Source
var FfiConverterCommitOptionsINSTANCE = FfiConverterCommitOptions{}
View Source
var FfiConverterConfigureINSTANCE = FfiConverterConfigure{}
View Source
var FfiConverterContainerDiffINSTANCE = FfiConverterContainerDiff{}
View Source
var FfiConverterContainerIdAndDiffINSTANCE = FfiConverterContainerIdAndDiff{}
View Source
var FfiConverterContainerIdINSTANCE = FfiConverterContainerId{}
View Source
var FfiConverterContainerIdLikeINSTANCE = FfiConverterContainerIdLike{
	// contains filtered or unexported fields
}
View Source
var FfiConverterContainerPathINSTANCE = FfiConverterContainerPath{}
View Source
var FfiConverterContainerTypeINSTANCE = FfiConverterContainerType{}
View Source
var FfiConverterCounterSpanINSTANCE = FfiConverterCounterSpan{}
View Source
var FfiConverterCursorINSTANCE = FfiConverterCursor{}
View Source
var FfiConverterCursorWithPosINSTANCE = FfiConverterCursorWithPos{}
View Source
var FfiConverterDiffBatchINSTANCE = FfiConverterDiffBatch{}
View Source
var FfiConverterDiffEventINSTANCE = FfiConverterDiffEvent{}
View Source
var FfiConverterDiffINSTANCE = FfiConverterDiff{}
View Source
var FfiConverterEphemeralEventTriggerINSTANCE = FfiConverterEphemeralEventTrigger{}
View Source
var FfiConverterEphemeralStoreEventINSTANCE = FfiConverterEphemeralStoreEvent{}
View Source
var FfiConverterEphemeralStoreINSTANCE = FfiConverterEphemeralStore{}
View Source
var FfiConverterEphemeralSubscriberINSTANCE = FfiConverterEphemeralSubscriber{
	// contains filtered or unexported fields
}
View Source
var FfiConverterEventTriggerKindINSTANCE = FfiConverterEventTriggerKind{}
View Source
var FfiConverterExpandTypeINSTANCE = FfiConverterExpandType{}
View Source
var FfiConverterExportModeINSTANCE = FfiConverterExportMode{}
View Source
var FfiConverterFirstCommitFromPeerCallbackINSTANCE = FfiConverterFirstCommitFromPeerCallback{
	// contains filtered or unexported fields
}
View Source
var FfiConverterFirstCommitFromPeerPayloadINSTANCE = FfiConverterFirstCommitFromPeerPayload{}
View Source
var FfiConverterFloat64INSTANCE = FfiConverterFloat64{}
View Source
var FfiConverterFractionalIndexINSTANCE = FfiConverterFractionalIndex{}
View Source
var FfiConverterFrontiersINSTANCE = FfiConverterFrontiers{}
View Source
var FfiConverterFrontiersOrIdINSTANCE = FfiConverterFrontiersOrId{}
View Source
var FfiConverterIdINSTANCE = FfiConverterId{}
View Source
var FfiConverterIdLpINSTANCE = FfiConverterIdLp{}
View Source
var FfiConverterIdSpanINSTANCE = FfiConverterIdSpan{}
View Source
var FfiConverterImportBlobMetadataINSTANCE = FfiConverterImportBlobMetadata{}
View Source
var FfiConverterImportStatusINSTANCE = FfiConverterImportStatus{}
View Source
var FfiConverterIndexINSTANCE = FfiConverterIndex{}
View Source
var FfiConverterInt32INSTANCE = FfiConverterInt32{}
View Source
var FfiConverterInt64INSTANCE = FfiConverterInt64{}
View Source
var FfiConverterJsonPathErrorINSTANCE = FfiConverterJsonPathError{}
View Source
var FfiConverterJsonPathSubscriberINSTANCE = FfiConverterJsonPathSubscriber{
	// contains filtered or unexported fields
}
View Source
var FfiConverterListDiffItemINSTANCE = FfiConverterListDiffItem{}
View Source
var FfiConverterLocalEphemeralListenerINSTANCE = FfiConverterLocalEphemeralListener{
	// contains filtered or unexported fields
}
View Source
var FfiConverterLocalUpdateCallbackINSTANCE = FfiConverterLocalUpdateCallback{
	// contains filtered or unexported fields
}
View Source
var FfiConverterLoroCounterINSTANCE = FfiConverterLoroCounter{}
View Source
var FfiConverterLoroDocINSTANCE = FfiConverterLoroDoc{}
View Source
var FfiConverterLoroEncodeErrorINSTANCE = FfiConverterLoroEncodeError{}
View Source
var FfiConverterLoroErrorINSTANCE = FfiConverterLoroError{}
View Source
var FfiConverterLoroListINSTANCE = FfiConverterLoroList{}
View Source
var FfiConverterLoroMapINSTANCE = FfiConverterLoroMap{}
View Source
var FfiConverterLoroMovableListINSTANCE = FfiConverterLoroMovableList{}
View Source
var FfiConverterLoroTextINSTANCE = FfiConverterLoroText{}
View Source
var FfiConverterLoroTreeINSTANCE = FfiConverterLoroTree{}
View Source
var FfiConverterLoroUnknownINSTANCE = FfiConverterLoroUnknown{}
View Source
var FfiConverterLoroValueINSTANCE = FfiConverterLoroValue{}
View Source
var FfiConverterLoroValueLikeINSTANCE = FfiConverterLoroValueLike{
	// contains filtered or unexported fields
}
View Source
var FfiConverterMapDeltaINSTANCE = FfiConverterMapDelta{}
View Source
var FfiConverterMapStringLoroValueINSTANCE = FfiConverterMapStringLoroValue{}
View Source
var FfiConverterMapStringOptionalValueOrContainerINSTANCE = FfiConverterMapStringOptionalValueOrContainer{}
View Source
var FfiConverterMapUint64CounterSpanINSTANCE = FfiConverterMapUint64CounterSpan{}
View Source
var FfiConverterMapUint64Int32INSTANCE = FfiConverterMapUint64Int32{}
View Source
var FfiConverterMapUint64PeerInfoINSTANCE = FfiConverterMapUint64PeerInfo{}
View Source
var FfiConverterOnPopINSTANCE = FfiConverterOnPop{
	// contains filtered or unexported fields
}
View Source
var FfiConverterOnPushINSTANCE = FfiConverterOnPush{
	// contains filtered or unexported fields
}
View Source
var FfiConverterOptionalChangeMetaINSTANCE = FfiConverterOptionalChangeMeta{}
View Source
var FfiConverterOptionalContainerIdINSTANCE = FfiConverterOptionalContainerId{}
View Source
var FfiConverterOptionalContainerTypeINSTANCE = FfiConverterOptionalContainerType{}
View Source
var FfiConverterOptionalCounterSpanINSTANCE = FfiConverterOptionalCounterSpan{}
View Source
var FfiConverterOptionalCursorINSTANCE = FfiConverterOptionalCursor{}
View Source
var FfiConverterOptionalDiffEventINSTANCE = FfiConverterOptionalDiffEvent{}
View Source
var FfiConverterOptionalDiffINSTANCE = FfiConverterOptionalDiff{}
View Source
var FfiConverterOptionalFloat64INSTANCE = FfiConverterOptionalFloat64{}
View Source
var FfiConverterOptionalFrontiersINSTANCE = FfiConverterOptionalFrontiers{}
View Source
var FfiConverterOptionalIdINSTANCE = FfiConverterOptionalId{}
View Source
var FfiConverterOptionalInt32INSTANCE = FfiConverterOptionalInt32{}
View Source
var FfiConverterOptionalInt64INSTANCE = FfiConverterOptionalInt64{}
View Source
var FfiConverterOptionalLoroCounterINSTANCE = FfiConverterOptionalLoroCounter{}
View Source
var FfiConverterOptionalLoroDocINSTANCE = FfiConverterOptionalLoroDoc{}
View Source
var FfiConverterOptionalLoroListINSTANCE = FfiConverterOptionalLoroList{}
View Source
var FfiConverterOptionalLoroMapINSTANCE = FfiConverterOptionalLoroMap{}
View Source
var FfiConverterOptionalLoroMovableListINSTANCE = FfiConverterOptionalLoroMovableList{}
View Source
var FfiConverterOptionalLoroTextINSTANCE = FfiConverterOptionalLoroText{}
View Source
var FfiConverterOptionalLoroTreeINSTANCE = FfiConverterOptionalLoroTree{}
View Source
var FfiConverterOptionalLoroUnknownINSTANCE = FfiConverterOptionalLoroUnknown{}
View Source
var FfiConverterOptionalLoroValueINSTANCE = FfiConverterOptionalLoroValue{}
View Source
var FfiConverterOptionalMapStringLoroValueINSTANCE = FfiConverterOptionalMapStringLoroValue{}
View Source
var FfiConverterOptionalMapUint64CounterSpanINSTANCE = FfiConverterOptionalMapUint64CounterSpan{}
View Source
var FfiConverterOptionalOnPopINSTANCE = FfiConverterOptionalOnPop{}
View Source
var FfiConverterOptionalOnPushINSTANCE = FfiConverterOptionalOnPush{}
View Source
var FfiConverterOptionalOrderingINSTANCE = FfiConverterOptionalOrdering{}
View Source
var FfiConverterOptionalSequenceContainerPathINSTANCE = FfiConverterOptionalSequenceContainerPath{}
View Source
var FfiConverterOptionalSequenceTreeIdINSTANCE = FfiConverterOptionalSequenceTreeId{}
View Source
var FfiConverterOptionalStringINSTANCE = FfiConverterOptionalString{}
View Source
var FfiConverterOptionalStyleConfigINSTANCE = FfiConverterOptionalStyleConfig{}
View Source
var FfiConverterOptionalSubscriptionINSTANCE = FfiConverterOptionalSubscription{}
View Source
var FfiConverterOptionalUint32INSTANCE = FfiConverterOptionalUint32{}
View Source
var FfiConverterOptionalUint64INSTANCE = FfiConverterOptionalUint64{}
View Source
var FfiConverterOptionalUndoItemMetaINSTANCE = FfiConverterOptionalUndoItemMeta{}
View Source
var FfiConverterOptionalValueOrContainerINSTANCE = FfiConverterOptionalValueOrContainer{}
View Source
var FfiConverterOptionalVersionVectorINSTANCE = FfiConverterOptionalVersionVector{}
View Source
var FfiConverterOrderingINSTANCE = FfiConverterOrdering{}
View Source
var FfiConverterPathItemINSTANCE = FfiConverterPathItem{}
View Source
var FfiConverterPeerInfoINSTANCE = FfiConverterPeerInfo{}
View Source
var FfiConverterPosQueryResultINSTANCE = FfiConverterPosQueryResult{}
View Source
var FfiConverterPosTypeINSTANCE = FfiConverterPosType{}
View Source
var FfiConverterPreCommitCallbackINSTANCE = FfiConverterPreCommitCallback{
	// contains filtered or unexported fields
}
View Source
var FfiConverterPreCommitCallbackPayloadINSTANCE = FfiConverterPreCommitCallbackPayload{}
View Source
var FfiConverterSequenceBytesINSTANCE = FfiConverterSequenceBytes{}
View Source
var FfiConverterSequenceContainerDiffINSTANCE = FfiConverterSequenceContainerDiff{}
View Source
var FfiConverterSequenceContainerIdAndDiffINSTANCE = FfiConverterSequenceContainerIdAndDiff{}
View Source
var FfiConverterSequenceContainerIdINSTANCE = FfiConverterSequenceContainerId{}
View Source
var FfiConverterSequenceContainerPathINSTANCE = FfiConverterSequenceContainerPath{}
View Source
var FfiConverterSequenceCursorWithPosINSTANCE = FfiConverterSequenceCursorWithPos{}
View Source
var FfiConverterSequenceIdINSTANCE = FfiConverterSequenceId{}
View Source
var FfiConverterSequenceIdSpanINSTANCE = FfiConverterSequenceIdSpan{}
View Source
var FfiConverterSequenceIndexINSTANCE = FfiConverterSequenceIndex{}
View Source
var FfiConverterSequenceListDiffItemINSTANCE = FfiConverterSequenceListDiffItem{}
View Source
var FfiConverterSequenceLoroValueINSTANCE = FfiConverterSequenceLoroValue{}
View Source
var FfiConverterSequencePathItemINSTANCE = FfiConverterSequencePathItem{}
View Source
var FfiConverterSequenceStringINSTANCE = FfiConverterSequenceString{}
View Source
var FfiConverterSequenceTextDeltaINSTANCE = FfiConverterSequenceTextDelta{}
View Source
var FfiConverterSequenceTreeDiffItemINSTANCE = FfiConverterSequenceTreeDiffItem{}
View Source
var FfiConverterSequenceTreeIdINSTANCE = FfiConverterSequenceTreeId{}
View Source
var FfiConverterSequenceUint64INSTANCE = FfiConverterSequenceUint64{}
View Source
var FfiConverterSequenceValueOrContainerINSTANCE = FfiConverterSequenceValueOrContainer{}
View Source
var FfiConverterSequenceVersionRangeItemINSTANCE = FfiConverterSequenceVersionRangeItem{}
View Source
var FfiConverterSideINSTANCE = FfiConverterSide{}
View Source
var FfiConverterStringINSTANCE = FfiConverterString{}
View Source
var FfiConverterStyleConfigINSTANCE = FfiConverterStyleConfig{}
View Source
var FfiConverterStyleConfigMapINSTANCE = FfiConverterStyleConfigMap{}
View Source
var FfiConverterSubscriberINSTANCE = FfiConverterSubscriber{
	// contains filtered or unexported fields
}
View Source
var FfiConverterSubscriptionINSTANCE = FfiConverterSubscription{}
View Source
var FfiConverterTextDeltaINSTANCE = FfiConverterTextDelta{}
View Source
var FfiConverterTreeDiffINSTANCE = FfiConverterTreeDiff{}
View Source
var FfiConverterTreeDiffItemINSTANCE = FfiConverterTreeDiffItem{}
View Source
var FfiConverterTreeExternalDiffINSTANCE = FfiConverterTreeExternalDiff{}
View Source
var FfiConverterTreeIdINSTANCE = FfiConverterTreeId{}
View Source
var FfiConverterTreeParentIdINSTANCE = FfiConverterTreeParentId{}
View Source
var FfiConverterUint32INSTANCE = FfiConverterUint32{}
View Source
var FfiConverterUint64INSTANCE = FfiConverterUint64{}
View Source
var FfiConverterUint8INSTANCE = FfiConverterUint8{}
View Source
var FfiConverterUndoItemMetaINSTANCE = FfiConverterUndoItemMeta{}
View Source
var FfiConverterUndoManagerINSTANCE = FfiConverterUndoManager{}
View Source
var FfiConverterUndoOrRedoINSTANCE = FfiConverterUndoOrRedo{}
View Source
var FfiConverterUnsubscriberINSTANCE = FfiConverterUnsubscriber{
	// contains filtered or unexported fields
}
View Source
var FfiConverterUpdateOptionsINSTANCE = FfiConverterUpdateOptions{}
View Source
var FfiConverterUpdateTimeoutErrorINSTANCE = FfiConverterUpdateTimeoutError{}
View Source
var FfiConverterValueOrContainerINSTANCE = FfiConverterValueOrContainer{}
View Source
var FfiConverterVersionRangeINSTANCE = FfiConverterVersionRange{}
View Source
var FfiConverterVersionRangeItemINSTANCE = FfiConverterVersionRangeItem{}
View Source
var FfiConverterVersionVectorDiffINSTANCE = FfiConverterVersionVectorDiff{}
View Source
var FfiConverterVersionVectorINSTANCE = FfiConverterVersionVector{}
View Source
var UniffiVTableCallbackInterfaceChangeAncestorsTravelerINSTANCE = C.UniffiVTableCallbackInterfaceChangeAncestorsTraveler{
	// contains filtered or unexported fields
}
View Source
var UniffiVTableCallbackInterfaceContainerIdLikeINSTANCE = C.UniffiVTableCallbackInterfaceContainerIdLike{
	// contains filtered or unexported fields
}
View Source
var UniffiVTableCallbackInterfaceEphemeralSubscriberINSTANCE = C.UniffiVTableCallbackInterfaceEphemeralSubscriber{
	// contains filtered or unexported fields
}
View Source
var UniffiVTableCallbackInterfaceFirstCommitFromPeerCallbackINSTANCE = C.UniffiVTableCallbackInterfaceFirstCommitFromPeerCallback{
	// contains filtered or unexported fields
}
View Source
var UniffiVTableCallbackInterfaceJsonPathSubscriberINSTANCE = C.UniffiVTableCallbackInterfaceJsonPathSubscriber{
	// contains filtered or unexported fields
}
View Source
var UniffiVTableCallbackInterfaceLocalEphemeralListenerINSTANCE = C.UniffiVTableCallbackInterfaceLocalEphemeralListener{
	// contains filtered or unexported fields
}
View Source
var UniffiVTableCallbackInterfaceLocalUpdateCallbackINSTANCE = C.UniffiVTableCallbackInterfaceLocalUpdateCallback{
	// contains filtered or unexported fields
}
View Source
var UniffiVTableCallbackInterfaceLoroValueLikeINSTANCE = C.UniffiVTableCallbackInterfaceLoroValueLike{
	// contains filtered or unexported fields
}
View Source
var UniffiVTableCallbackInterfaceOnPopINSTANCE = C.UniffiVTableCallbackInterfaceOnPop{
	// contains filtered or unexported fields
}
View Source
var UniffiVTableCallbackInterfaceOnPushINSTANCE = C.UniffiVTableCallbackInterfaceOnPush{
	// contains filtered or unexported fields
}
View Source
var UniffiVTableCallbackInterfacePreCommitCallbackINSTANCE = C.UniffiVTableCallbackInterfacePreCommitCallback{
	// contains filtered or unexported fields
}
View Source
var UniffiVTableCallbackInterfaceSubscriberINSTANCE = C.UniffiVTableCallbackInterfaceSubscriber{
	// contains filtered or unexported fields
}
View Source
var UniffiVTableCallbackInterfaceUnsubscriberINSTANCE = C.UniffiVTableCallbackInterfaceUnsubscriber{
	// contains filtered or unexported fields
}

Functions

func CFromRustBuffer added in v0.3.0

func CFromRustBuffer(b ExternalCRustBuffer) C.RustBuffer

func Deref added in v0.4.0

func Deref[T any](v **T) *T

Deref unwraps a double pointer returned by some generated bindings methods. Returns nil if v is nil or *v is nil; otherwise returns *v.

Useful as an escape hatch for the few `**T` returns not covered by typed wrapper methods (e.g. LoroDoc.FrontiersToVv).

func GetAnyValue

func GetAnyValue(v **ValueOrContainer) (any, bool)

GetAnyValue takes a pointer to a ValueOrContainer and returns the value as an any.

func GetBoolValue

func GetBoolValue(v **ValueOrContainer) (bool, bool)

GetBoolValue takes a pointer to a ValueOrContainer and returns the bool value if it is a bool.

func GetFloat64Value

func GetFloat64Value(v **ValueOrContainer) (float64, bool)

GetFloat64Value takes a pointer to a ValueOrContainer and returns the float64 value if it is a float64.

func GetInt64Value

func GetInt64Value(v **ValueOrContainer) (int64, bool)

GetInt64Value takes a pointer to a ValueOrContainer and returns the int64 value if it is an int64.

func GetListValueOfAny

func GetListValueOfAny(v **ValueOrContainer) ([]any, bool)

GetListValueOfAny takes a pointer to a ValueOrContainer and returns a slice of any if it is a list.

func GetMapValue

func GetMapValue(v **ValueOrContainer) (map[string]LoroValue, bool)

GetMapValue takes a pointer to a ValueOrContainer and returns the map value if it is a map.

func GetMapValueOfAny

func GetMapValueOfAny(v **ValueOrContainer) (map[string]any, bool)

GetMapValueOfAny takes a pointer to a ValueOrContainer and returns a map of string to any if it is a map.

func GetStringValue

func GetStringValue(v **ValueOrContainer) (string, bool)

GetStringValue takes a pointer to a ValueOrContainer and returns the string value if it is a string.

func GetVersion

func GetVersion() string

func IsValueExplicitlyNil

func IsValueExplicitlyNil(v **ValueOrContainer) bool

IsValueExplicitlyNil checks if a pointer to a ValueOrContainer is explicitly nil, meaning it has a LoroValueNull value.

func LiftFromRustBuffer

func LiftFromRustBuffer[GoType any](bufReader BufReader[GoType], rbuf RustBufferI) GoType

func LowerIntoRustBuffer

func LowerIntoRustBuffer[GoType any](bufWriter BufWriter[GoType], value GoType) C.RustBuffer

func LowerToExternalAwareness added in v0.3.0

func LowerToExternalAwareness(value *Awareness) uint64

func LowerToExternalChangeAncestorsTraveler added in v0.3.0

func LowerToExternalChangeAncestorsTraveler(value ChangeAncestorsTraveler) uint64

func LowerToExternalChangeModifier added in v0.3.0

func LowerToExternalChangeModifier(value *ChangeModifier) uint64

func LowerToExternalConfigure added in v0.3.0

func LowerToExternalConfigure(value *Configure) uint64

func LowerToExternalContainerIdLike added in v0.3.0

func LowerToExternalContainerIdLike(value ContainerIdLike) uint64

func LowerToExternalCursor added in v0.3.0

func LowerToExternalCursor(value *Cursor) uint64

func LowerToExternalDiffBatch added in v0.3.0

func LowerToExternalDiffBatch(value *DiffBatch) uint64

func LowerToExternalEphemeralStore added in v0.3.0

func LowerToExternalEphemeralStore(value *EphemeralStore) uint64

func LowerToExternalEphemeralSubscriber added in v0.3.0

func LowerToExternalEphemeralSubscriber(value EphemeralSubscriber) uint64

func LowerToExternalFirstCommitFromPeerCallback added in v0.3.0

func LowerToExternalFirstCommitFromPeerCallback(value FirstCommitFromPeerCallback) uint64

func LowerToExternalFractionalIndex added in v0.3.0

func LowerToExternalFractionalIndex(value *FractionalIndex) uint64

func LowerToExternalFrontiers added in v0.3.0

func LowerToExternalFrontiers(value *Frontiers) uint64

func LowerToExternalJsonPathSubscriber added in v0.3.0

func LowerToExternalJsonPathSubscriber(value JsonPathSubscriber) uint64

func LowerToExternalLocalEphemeralListener added in v0.3.0

func LowerToExternalLocalEphemeralListener(value LocalEphemeralListener) uint64

func LowerToExternalLocalUpdateCallback added in v0.3.0

func LowerToExternalLocalUpdateCallback(value LocalUpdateCallback) uint64

func LowerToExternalLoroCounter added in v0.3.0

func LowerToExternalLoroCounter(value *LoroCounter) uint64

func LowerToExternalLoroDoc added in v0.3.0

func LowerToExternalLoroDoc(value *LoroDoc) uint64

func LowerToExternalLoroList added in v0.3.0

func LowerToExternalLoroList(value *LoroList) uint64

func LowerToExternalLoroMap added in v0.3.0

func LowerToExternalLoroMap(value *LoroMap) uint64

func LowerToExternalLoroMovableList added in v0.3.0

func LowerToExternalLoroMovableList(value *LoroMovableList) uint64

func LowerToExternalLoroText added in v0.3.0

func LowerToExternalLoroText(value *LoroText) uint64

func LowerToExternalLoroTree added in v0.3.0

func LowerToExternalLoroTree(value *LoroTree) uint64

func LowerToExternalLoroUnknown added in v0.3.0

func LowerToExternalLoroUnknown(value *LoroUnknown) uint64

func LowerToExternalLoroValueLike added in v0.3.0

func LowerToExternalLoroValueLike(value LoroValueLike) uint64

func LowerToExternalOnPop added in v0.3.0

func LowerToExternalOnPop(value OnPop) uint64

func LowerToExternalOnPush added in v0.3.0

func LowerToExternalOnPush(value OnPush) uint64

func LowerToExternalPreCommitCallback added in v0.3.0

func LowerToExternalPreCommitCallback(value PreCommitCallback) uint64

func LowerToExternalStyleConfigMap added in v0.3.0

func LowerToExternalStyleConfigMap(value *StyleConfigMap) uint64

func LowerToExternalSubscriber added in v0.3.0

func LowerToExternalSubscriber(value Subscriber) uint64

func LowerToExternalSubscription added in v0.3.0

func LowerToExternalSubscription(value *Subscription) uint64

func LowerToExternalUndoManager added in v0.3.0

func LowerToExternalUndoManager(value *UndoManager) uint64

func LowerToExternalUnsubscriber added in v0.3.0

func LowerToExternalUnsubscriber(value Unsubscriber) uint64

func LowerToExternalValueOrContainer added in v0.3.0

func LowerToExternalValueOrContainer(value *ValueOrContainer) uint64

func LowerToExternalVersionRange added in v0.3.0

func LowerToExternalVersionRange(value *VersionRange) uint64

func LowerToExternalVersionVector added in v0.3.0

func LowerToExternalVersionVector(value *VersionVector) uint64

func ValueAsAny added in v0.4.0

func ValueAsAny(value LoroValue) (any, bool)

ValueAsAny converts a LoroValue to its idiomatic Go representation, recursing into lists and maps. Returns false if the value is of an unsupported variant.

func ValueAsBinary added in v0.4.0

func ValueAsBinary(value LoroValue) ([]byte, bool)

ValueAsBinary returns the byte slice contents of a LoroValue if it holds binary data.

func ValueAsBool added in v0.4.0

func ValueAsBool(value LoroValue) (bool, bool)

ValueAsBool returns the bool contents of a LoroValue if it holds a bool.

func ValueAsFloat64 added in v0.4.0

func ValueAsFloat64(value LoroValue) (float64, bool)

ValueAsFloat64 returns the float64 contents of a LoroValue if it holds a float. No implicit conversion from int is performed.

func ValueAsInt64 added in v0.4.0

func ValueAsInt64(value LoroValue) (int64, bool)

ValueAsInt64 returns the int64 contents of a LoroValue if it holds an int64. No implicit conversion from float is performed.

func ValueAsMap added in v0.4.0

func ValueAsMap(value LoroValue) (map[string]LoroValue, bool)

ValueAsMap returns the map contents of a LoroValue if it holds a map.

func ValueAsString added in v0.4.0

func ValueAsString(value LoroValue) (string, bool)

ValueAsString returns the string contents of a LoroValue if it holds a string.

func ValueIsNil added in v0.4.0

func ValueIsNil(value LoroValue) bool

ValueIsNil reports whether the LoroValue is an explicit null.

Types

type AbsolutePosition

type AbsolutePosition struct {
	Pos  uint32
	Side Side
}

func (*AbsolutePosition) Destroy

func (r *AbsolutePosition) Destroy()

type Awareness

type Awareness struct {
	// contains filtered or unexported fields
}

Deprecated, use `EphemeralStore` instead.

func LiftFromExternalAwareness added in v0.3.0

func LiftFromExternalAwareness(handle uint64) *Awareness

func NewAwareness

func NewAwareness(peer uint64, timeout int64) *Awareness

func (*Awareness) Apply

func (_self *Awareness) Apply(encodedPeersInfo []byte) AwarenessPeerUpdate

func (*Awareness) Destroy

func (object *Awareness) Destroy()

func (*Awareness) Encode

func (_self *Awareness) Encode(peers []uint64) []byte

func (*Awareness) EncodeAll

func (_self *Awareness) EncodeAll() []byte

func (*Awareness) GetAllStates

func (_self *Awareness) GetAllStates() map[uint64]PeerInfo

func (*Awareness) GetLocalState

func (_self *Awareness) GetLocalState() *LoroValue

func (*Awareness) Peer

func (_self *Awareness) Peer() uint64

func (*Awareness) RemoveOutdated

func (_self *Awareness) RemoveOutdated() []uint64

func (*Awareness) SetLocalState

func (_self *Awareness) SetLocalState(value LoroValueLike)

func (*Awareness) SetLocalStateAny added in v0.4.0

func (a *Awareness) SetLocalStateAny(v any) error

SetLocalStateAny sets the local awareness state to a plain Go value. The value is converted via AsValue; passing an unsupported type returns an error without modifying the awareness state.

type AwarenessInterface

type AwarenessInterface interface {
	Apply(encodedPeersInfo []byte) AwarenessPeerUpdate
	Encode(peers []uint64) []byte
	EncodeAll() []byte
	GetAllStates() map[uint64]PeerInfo
	GetLocalState() *LoroValue
	Peer() uint64
	RemoveOutdated() []uint64
	SetLocalState(value LoroValueLike)
}

Deprecated, use `EphemeralStore` instead.

type AwarenessPeerUpdate

type AwarenessPeerUpdate struct {
	Updated []uint64
	Added   []uint64
}

func (*AwarenessPeerUpdate) Destroy

func (r *AwarenessPeerUpdate) Destroy()

type BufLifter

type BufLifter[GoType any] interface {
	Lift(value RustBufferI) GoType
}

type BufLowerer

type BufLowerer[GoType any] interface {
	Lower(value GoType) C.RustBuffer
}

type BufReader

type BufReader[GoType any] interface {
	Read(reader io.Reader) GoType
}

type BufWriter

type BufWriter[GoType any] interface {
	Write(writer io.Writer, value GoType)
}

type CannotFindRelativePosition

type CannotFindRelativePosition struct {
	// contains filtered or unexported fields
}

func NewCannotFindRelativePositionContainerDeleted

func NewCannotFindRelativePositionContainerDeleted() *CannotFindRelativePosition

func NewCannotFindRelativePositionHistoryCleared

func NewCannotFindRelativePositionHistoryCleared() *CannotFindRelativePosition

func NewCannotFindRelativePositionIdNotFound

func NewCannotFindRelativePositionIdNotFound() *CannotFindRelativePosition

func (*CannotFindRelativePosition) AsError

func (err *CannotFindRelativePosition) AsError() error

Convenience method to turn *CannotFindRelativePosition into error Avoiding treating nil pointer as non nil error interface

func (CannotFindRelativePosition) Error

func (err CannotFindRelativePosition) Error() string

func (CannotFindRelativePosition) Unwrap

func (err CannotFindRelativePosition) Unwrap() error

type CannotFindRelativePositionContainerDeleted

type CannotFindRelativePositionContainerDeleted struct {
	// contains filtered or unexported fields
}

Variant structs

func (CannotFindRelativePositionContainerDeleted) Error

func (CannotFindRelativePositionContainerDeleted) Is

type CannotFindRelativePositionHistoryCleared

type CannotFindRelativePositionHistoryCleared struct {
	// contains filtered or unexported fields
}

func (CannotFindRelativePositionHistoryCleared) Error

func (CannotFindRelativePositionHistoryCleared) Is

type CannotFindRelativePositionIdNotFound

type CannotFindRelativePositionIdNotFound struct {
	// contains filtered or unexported fields
}

func (CannotFindRelativePositionIdNotFound) Error

func (CannotFindRelativePositionIdNotFound) Is

type ChangeAncestorsTraveler

type ChangeAncestorsTraveler interface {
	Travel(change ChangeMeta) bool
}

func AsChangeAncestorCallback

func AsChangeAncestorCallback(fn ChangeAncestorsTravelerFn) ChangeAncestorsTraveler

AsChangeAncestorCallback adapts a function to the ChangeAncestorsTraveler interface.

func LiftFromExternalChangeAncestorsTraveler added in v0.3.0

func LiftFromExternalChangeAncestorsTraveler(handle uint64) ChangeAncestorsTraveler

type ChangeAncestorsTravelerFn

type ChangeAncestorsTravelerFn func(payload ChangeMeta) bool

ChangeAncestorsTravelerFn adapts a function to the ChangeAncestorsTraveler interface.

Use with LoroDoc.TravelChangeAncestors to walk the causal history of one or more changes. Return true to continue traversal, or false to stop early.

doc.TravelChangeAncestors(ids, loro.ChangeAncestorsTravelerFn(
	func(change loro.ChangeMeta) bool {
		fmt.Println("visiting change from peer:", change.Id.Peer)
		return true // continue traversal
	},
))

func (ChangeAncestorsTravelerFn) Travel

func (fn ChangeAncestorsTravelerFn) Travel(payload ChangeMeta) bool

type ChangeAncestorsTravelerImpl

type ChangeAncestorsTravelerImpl struct {
	// contains filtered or unexported fields
}

func (*ChangeAncestorsTravelerImpl) Destroy

func (object *ChangeAncestorsTravelerImpl) Destroy()

func (*ChangeAncestorsTravelerImpl) Travel

func (_self *ChangeAncestorsTravelerImpl) Travel(change ChangeMeta) bool

type ChangeMeta

type ChangeMeta struct {
	// Lamport timestamp of the Change
	Lamport uint32
	// The first Op id of the Change
	Id Id
	// [Unix time](https://en.wikipedia.org/wiki/Unix_time)
	// It is the number of seconds that have elapsed since 00:00:00 UTC on 1 January 1970.
	Timestamp int64
	// The commit message of the change
	Message *string
	// The dependencies of the first op of the change
	Deps *Frontiers
	// The total op num inside this change
	Len uint32
}

func (*ChangeMeta) Destroy

func (r *ChangeMeta) Destroy()

type ChangeModifier

type ChangeModifier struct {
	// contains filtered or unexported fields
}

func LiftFromExternalChangeModifier added in v0.3.0

func LiftFromExternalChangeModifier(handle uint64) *ChangeModifier

func (*ChangeModifier) Destroy

func (object *ChangeModifier) Destroy()

func (*ChangeModifier) SetMessage

func (_self *ChangeModifier) SetMessage(msg string)

func (*ChangeModifier) SetTimestamp

func (_self *ChangeModifier) SetTimestamp(timestamp int64)

type ChangeModifierInterface

type ChangeModifierInterface interface {
	SetMessage(msg string)
	SetTimestamp(timestamp int64)
}

type ChangeTravelError

type ChangeTravelError struct {
	// contains filtered or unexported fields
}

func NewChangeTravelErrorTargetIdNotFound

func NewChangeTravelErrorTargetIdNotFound() *ChangeTravelError

func NewChangeTravelErrorTargetVersionNotIncluded

func NewChangeTravelErrorTargetVersionNotIncluded() *ChangeTravelError

func (*ChangeTravelError) AsError

func (err *ChangeTravelError) AsError() error

Convenience method to turn *ChangeTravelError into error Avoiding treating nil pointer as non nil error interface

func (ChangeTravelError) Error

func (err ChangeTravelError) Error() string

func (ChangeTravelError) Unwrap

func (err ChangeTravelError) Unwrap() error

type ChangeTravelErrorTargetIdNotFound

type ChangeTravelErrorTargetIdNotFound struct {
	// contains filtered or unexported fields
}

Variant structs

func (ChangeTravelErrorTargetIdNotFound) Error

func (ChangeTravelErrorTargetIdNotFound) Is

type ChangeTravelErrorTargetVersionNotIncluded

type ChangeTravelErrorTargetVersionNotIncluded struct {
	// contains filtered or unexported fields
}

func (ChangeTravelErrorTargetVersionNotIncluded) Error

func (ChangeTravelErrorTargetVersionNotIncluded) Is

type CommitOptions

type CommitOptions struct {
	Origin         *string
	ImmediateRenew bool
	Timestamp      *int64
	CommitMsg      *string
}

func (*CommitOptions) Destroy

func (r *CommitOptions) Destroy()

type Configure

type Configure struct {
	// contains filtered or unexported fields
}

func LiftFromExternalConfigure added in v0.3.0

func LiftFromExternalConfigure(handle uint64) *Configure

func (*Configure) Destroy

func (object *Configure) Destroy()

func (*Configure) Fork

func (_self *Configure) Fork() *Configure

func (*Configure) MergeInterval

func (_self *Configure) MergeInterval() int64

func (*Configure) RecordTimestamp

func (_self *Configure) RecordTimestamp() bool

func (*Configure) SetMergeInterval

func (_self *Configure) SetMergeInterval(interval int64)

func (*Configure) SetRecordTimestamp

func (_self *Configure) SetRecordTimestamp(record bool)

func (*Configure) TextStyleConfig

func (_self *Configure) TextStyleConfig() *StyleConfigMap

type ConfigureInterface

type ConfigureInterface interface {
	Fork() *Configure
	MergeInterval() int64
	RecordTimestamp() bool
	SetMergeInterval(interval int64)
	SetRecordTimestamp(record bool)
	TextStyleConfig() *StyleConfigMap
}

type ContainerDiff

type ContainerDiff struct {
	// The target container id of the diff.
	Target ContainerId
	// The path of the diff.
	Path []PathItem
	// Whether the diff is from unknown container.
	IsUnknown bool
	// The diff
	Diff Diff
}

A diff of a container.

func (*ContainerDiff) Destroy

func (r *ContainerDiff) Destroy()

type ContainerId

type ContainerId interface {
	Destroy()
}

func CounterRoot added in v0.4.0

func CounterRoot(name string) ContainerId

CounterRoot returns the root ContainerId for a counter with the given name. Useful for APIs that take a ContainerId directly, such as HasContainer, DeleteRootContainer, and GetPathToContainer.

func ListRoot added in v0.4.0

func ListRoot(name string) ContainerId

ListRoot returns the root ContainerId for a list with the given name. Useful for APIs that take a ContainerId directly, such as HasContainer, DeleteRootContainer, and GetPathToContainer.

func MapRoot added in v0.4.0

func MapRoot(name string) ContainerId

MapRoot returns the root ContainerId for a map with the given name. Useful for APIs that take a ContainerId directly, such as HasContainer, DeleteRootContainer, and GetPathToContainer.

func MovableListRoot added in v0.4.0

func MovableListRoot(name string) ContainerId

MovableListRoot returns the root ContainerId for a movable list with the given name. Useful for APIs that take a ContainerId directly, such as HasContainer, DeleteRootContainer, and GetPathToContainer.

func TextRoot added in v0.4.0

func TextRoot(name string) ContainerId

TextRoot returns the root ContainerId for a text container with the given name. Useful for APIs that take a ContainerId directly, such as HasContainer, DeleteRootContainer, and GetPathToContainer.

func TreeRoot added in v0.4.0

func TreeRoot(name string) ContainerId

TreeRoot returns the root ContainerId for a tree with the given name. Useful for APIs that take a ContainerId directly, such as HasContainer, DeleteRootContainer, and GetPathToContainer.

type ContainerIdAndDiff

type ContainerIdAndDiff struct {
	Cid  ContainerId
	Diff Diff
}

func (*ContainerIdAndDiff) Destroy

func (r *ContainerIdAndDiff) Destroy()

type ContainerIdLike

type ContainerIdLike interface {
	AsContainerId(ty ContainerType) ContainerId
}

func LiftFromExternalContainerIdLike added in v0.3.0

func LiftFromExternalContainerIdLike(handle uint64) ContainerIdLike

type ContainerIdLikeImpl

type ContainerIdLikeImpl struct {
	// contains filtered or unexported fields
}

func (*ContainerIdLikeImpl) AsContainerId

func (_self *ContainerIdLikeImpl) AsContainerId(ty ContainerType) ContainerId

func (*ContainerIdLikeImpl) Destroy

func (object *ContainerIdLikeImpl) Destroy()

type ContainerIdNormal

type ContainerIdNormal struct {
	Peer          uint64
	Counter       int32
	ContainerType ContainerType
}

func (ContainerIdNormal) Destroy

func (e ContainerIdNormal) Destroy()

func (ContainerIdNormal) String added in v0.4.0

func (e ContainerIdNormal) String() string

type ContainerIdRoot

type ContainerIdRoot struct {
	Name          string
	ContainerType ContainerType
}

func (ContainerIdRoot) Destroy

func (e ContainerIdRoot) Destroy()

func (ContainerIdRoot) String added in v0.4.0

func (e ContainerIdRoot) String() string

type ContainerPath

type ContainerPath struct {
	Id   ContainerId
	Path Index
}

func (*ContainerPath) Destroy

func (r *ContainerPath) Destroy()

type ContainerType

type ContainerType interface {
	Destroy()
}

ContainerType singletons. Use these instead of the zero-value struct literals (e.g. ContainerTypeMap{}) when building ContainerIdRoot or calling any API that takes a ContainerType.

doc.GetContainer(loro.ContainerIdRoot{Name: "data", ContainerType: loro.MapType})

type ContainerTypeCounter

type ContainerTypeCounter struct {
}

func (ContainerTypeCounter) Destroy

func (e ContainerTypeCounter) Destroy()

func (ContainerTypeCounter) String added in v0.4.0

func (ContainerTypeCounter) String() string

type ContainerTypeList

type ContainerTypeList struct {
}

func (ContainerTypeList) Destroy

func (e ContainerTypeList) Destroy()

func (ContainerTypeList) String added in v0.4.0

func (ContainerTypeList) String() string

type ContainerTypeMap

type ContainerTypeMap struct {
}

func (ContainerTypeMap) Destroy

func (e ContainerTypeMap) Destroy()

func (ContainerTypeMap) String added in v0.4.0

func (ContainerTypeMap) String() string

type ContainerTypeMovableList

type ContainerTypeMovableList struct {
}

func (ContainerTypeMovableList) Destroy

func (e ContainerTypeMovableList) Destroy()

func (ContainerTypeMovableList) String added in v0.4.0

type ContainerTypeText

type ContainerTypeText struct {
}

func (ContainerTypeText) Destroy

func (e ContainerTypeText) Destroy()

func (ContainerTypeText) String added in v0.4.0

func (ContainerTypeText) String() string

type ContainerTypeTree

type ContainerTypeTree struct {
}

func (ContainerTypeTree) Destroy

func (e ContainerTypeTree) Destroy()

func (ContainerTypeTree) String added in v0.4.0

func (ContainerTypeTree) String() string

type ContainerTypeUnknown

type ContainerTypeUnknown struct {
	Kind uint8
}

func (ContainerTypeUnknown) Destroy

func (e ContainerTypeUnknown) Destroy()

func (ContainerTypeUnknown) String added in v0.4.0

func (e ContainerTypeUnknown) String() string

type CounterSpan

type CounterSpan struct {
	Start int32
	End   int32
}

func (*CounterSpan) Destroy

func (r *CounterSpan) Destroy()

func (CounterSpan) String added in v0.4.0

func (s CounterSpan) String() string

type Cursor

type Cursor struct {
	// contains filtered or unexported fields
}

func CursorDecode

func CursorDecode(data []byte) (*Cursor, error)

func LiftFromExternalCursor added in v0.3.0

func LiftFromExternalCursor(handle uint64) *Cursor

func NewCursor

func NewCursor(id *Id, container ContainerId, side Side, originPos uint32) *Cursor

func (*Cursor) Destroy

func (object *Cursor) Destroy()

func (*Cursor) Encode

func (_self *Cursor) Encode() []byte

func (*Cursor) String added in v0.4.0

func (c *Cursor) String() string

type CursorInterface

type CursorInterface interface {
	Encode() []byte
}

type CursorWithPos

type CursorWithPos struct {
	Cursor *Cursor
	Pos    AbsolutePosition
}

func (*CursorWithPos) Destroy

func (r *CursorWithPos) Destroy()

type Diff

type Diff interface {
	Destroy()
}

type DiffBatch

type DiffBatch struct {
	// contains filtered or unexported fields
}

func LiftFromExternalDiffBatch added in v0.3.0

func LiftFromExternalDiffBatch(handle uint64) *DiffBatch

func NewDiffBatch

func NewDiffBatch() *DiffBatch

func (*DiffBatch) Destroy

func (object *DiffBatch) Destroy()

func (*DiffBatch) GetDiff

func (_self *DiffBatch) GetDiff() []ContainerIdAndDiff

Returns an iterator over the diffs in this batch, in the order they were added.

The iterator yields tuples of `(&ContainerID, &Diff)` where: - `ContainerID` is the ID of the container that was modified - `Diff` contains the actual changes made to that container

The order of the diffs is preserved from when they were originally added to the batch.

func (*DiffBatch) Push

func (_self *DiffBatch) Push(cid ContainerId, diff Diff) *Diff

Push a new event to the batch.

If the cid already exists in the batch, return Err

type DiffBatchInterface

type DiffBatchInterface interface {
	// Returns an iterator over the diffs in this batch, in the order they were added.
	//
	// The iterator yields tuples of `(&ContainerID, &Diff)` where:
	// - `ContainerID` is the ID of the container that was modified
	// - `Diff` contains the actual changes made to that container
	//
	// The order of the diffs is preserved from when they were originally added to the batch.
	GetDiff() []ContainerIdAndDiff
	// Push a new event to the batch.
	//
	// If the cid already exists in the batch, return Err
	Push(cid ContainerId, diff Diff) *Diff
}

type DiffCounter

type DiffCounter struct {
	Diff float64
}

func (DiffCounter) Destroy

func (e DiffCounter) Destroy()

type DiffEvent

type DiffEvent struct {
	// How the event is triggered.
	TriggeredBy EventTriggerKind
	// The origin of the event.
	Origin string
	// The current receiver of the event.
	CurrentTarget *ContainerId
	// The diffs of the event.
	Events []ContainerDiff
}

func (*DiffEvent) Destroy

func (r *DiffEvent) Destroy()

type DiffList

type DiffList struct {
	Diff []ListDiffItem
}

func (DiffList) Destroy

func (e DiffList) Destroy()

type DiffMap

type DiffMap struct {
	Diff MapDelta
}

func (DiffMap) Destroy

func (e DiffMap) Destroy()

type DiffText

type DiffText struct {
	Diff []TextDelta
}

func (DiffText) Destroy

func (e DiffText) Destroy()

type DiffTree

type DiffTree struct {
	Diff TreeDiff
}

func (DiffTree) Destroy

func (e DiffTree) Destroy()

type DiffUnknown

type DiffUnknown struct {
}

func (DiffUnknown) Destroy

func (e DiffUnknown) Destroy()

type EphemeralEventTrigger

type EphemeralEventTrigger uint
const (
	EphemeralEventTriggerLocal   EphemeralEventTrigger = 1
	EphemeralEventTriggerImport  EphemeralEventTrigger = 2
	EphemeralEventTriggerTimeout EphemeralEventTrigger = 3
)

type EphemeralStore

type EphemeralStore struct {
	// contains filtered or unexported fields
}

func LiftFromExternalEphemeralStore added in v0.3.0

func LiftFromExternalEphemeralStore(handle uint64) *EphemeralStore

func NewEphemeralStore

func NewEphemeralStore(timeout int64) *EphemeralStore

func (*EphemeralStore) Apply

func (_self *EphemeralStore) Apply(data []byte) error

func (*EphemeralStore) Delete

func (_self *EphemeralStore) Delete(key string)

func (*EphemeralStore) Destroy

func (object *EphemeralStore) Destroy()

func (*EphemeralStore) Encode

func (_self *EphemeralStore) Encode(key string) []byte

func (*EphemeralStore) EncodeAll

func (_self *EphemeralStore) EncodeAll() []byte

func (*EphemeralStore) Get

func (_self *EphemeralStore) Get(key string) *LoroValue

func (*EphemeralStore) GetAllStates

func (_self *EphemeralStore) GetAllStates() map[string]LoroValue

func (*EphemeralStore) Keys

func (_self *EphemeralStore) Keys() []string

func (*EphemeralStore) RemoveOutdated

func (_self *EphemeralStore) RemoveOutdated()

func (*EphemeralStore) Set

func (_self *EphemeralStore) Set(key string, value LoroValueLike)

func (*EphemeralStore) SetAny added in v0.4.0

func (s *EphemeralStore) SetAny(key string, v any) error

SetAny sets the ephemeral key to a plain Go value. The value is converted via AsValue; passing an unsupported type returns an error without modifying the store.

func (*EphemeralStore) Subscribe

func (_self *EphemeralStore) Subscribe(listener EphemeralSubscriber) *Subscription

func (*EphemeralStore) SubscribeFn added in v0.4.0

func (s *EphemeralStore) SubscribeFn(fn func(event EphemeralStoreEvent)) *Subscription

SubscribeFn is a convenience wrapper around EphemeralStore.Subscribe that accepts a plain function instead of an EphemeralSubscriber interface.

sub := store.SubscribeFn(func(event loro.EphemeralStoreEvent) {
	fmt.Println("ephemeral keys updated:", event.Updated)
})
defer sub.Unsubscribe()

func (*EphemeralStore) SubscribeLocalUpdate

func (_self *EphemeralStore) SubscribeLocalUpdate(listener LocalEphemeralListener) *Subscription

func (*EphemeralStore) SubscribeLocalUpdateFn added in v0.4.0

func (s *EphemeralStore) SubscribeLocalUpdateFn(fn func(update []byte)) *Subscription

SubscribeLocalUpdateFn is a convenience wrapper around EphemeralStore.SubscribeLocalUpdate that accepts a plain function instead of a LocalEphemeralListener interface.

sub := store.SubscribeLocalUpdateFn(func(update []byte) {
	_ = conn.Send(update) // broadcast ephemeral update
})
defer sub.Unsubscribe()

type EphemeralStoreEvent

type EphemeralStoreEvent struct {
	By      EphemeralEventTrigger
	Added   []string
	Removed []string
	Updated []string
}

func (*EphemeralStoreEvent) Destroy

func (r *EphemeralStoreEvent) Destroy()

type EphemeralStoreInterface

type EphemeralStoreInterface interface {
	Apply(data []byte) error
	Delete(key string)
	Encode(key string) []byte
	EncodeAll() []byte
	Get(key string) *LoroValue
	GetAllStates() map[string]LoroValue
	Keys() []string
	RemoveOutdated()
	Set(key string, value LoroValueLike)
	Subscribe(listener EphemeralSubscriber) *Subscription
	SubscribeLocalUpdate(listener LocalEphemeralListener) *Subscription
}

type EphemeralSubscriber

type EphemeralSubscriber interface {
	OnEphemeralEvent(event EphemeralStoreEvent)
}

func AsEphemeralSubscriber

func AsEphemeralSubscriber(fn EphemeralSubscriberFn) EphemeralSubscriber

AsEphemeralSubscriber adapts a function to the EphemeralSubscriber interface.

func LiftFromExternalEphemeralSubscriber added in v0.3.0

func LiftFromExternalEphemeralSubscriber(handle uint64) EphemeralSubscriber

type EphemeralSubscriberFn

type EphemeralSubscriberFn func(event EphemeralStoreEvent)

EphemeralSubscriberFn adapts a function to the EphemeralSubscriber interface.

Use with EphemeralStore.Subscribe to observe changes to the ephemeral store, such as awareness/presence updates from peers.

sub := store.Subscribe(loro.EphemeralSubscriberFn(func(event loro.EphemeralStoreEvent) {
	for _, key := range event.Updated {
		fmt.Println("peer updated:", key)
	}
}))
defer sub.Unsubscribe()

func (EphemeralSubscriberFn) OnEphemeralEvent

func (fn EphemeralSubscriberFn) OnEphemeralEvent(event EphemeralStoreEvent)

type EphemeralSubscriberImpl

type EphemeralSubscriberImpl struct {
	// contains filtered or unexported fields
}

func (*EphemeralSubscriberImpl) Destroy

func (object *EphemeralSubscriberImpl) Destroy()

func (*EphemeralSubscriberImpl) OnEphemeralEvent

func (_self *EphemeralSubscriberImpl) OnEphemeralEvent(event EphemeralStoreEvent)

type EventTriggerKind

type EventTriggerKind uint

The kind of the event trigger.

const (
	// The event is triggered by a local transaction.
	EventTriggerKindLocal EventTriggerKind = 1
	// The event is triggered by importing
	EventTriggerKindImport EventTriggerKind = 2
	// The event is triggered by checkout
	EventTriggerKindCheckout EventTriggerKind = 3
)

func (EventTriggerKind) String added in v0.4.0

func (k EventTriggerKind) String() string

type ExpandType

type ExpandType uint
const (
	ExpandTypeBefore ExpandType = 1
	ExpandTypeAfter  ExpandType = 2
	ExpandTypeBoth   ExpandType = 3
	ExpandTypeNone   ExpandType = 4
)

func (ExpandType) String added in v0.4.0

func (e ExpandType) String() string

type ExportMode added in v0.3.0

type ExportMode interface {
	Destroy()
}

func ShallowSnapshotMode added in v0.4.0

func ShallowSnapshotMode(frontiers *Frontiers) ExportMode

ShallowSnapshotMode returns an ExportMode that exports a snapshot trimmed at the given frontiers, discarding earlier history.

func SnapshotAtMode added in v0.4.0

func SnapshotAtMode(frontiers *Frontiers) ExportMode

SnapshotAtMode returns an ExportMode that exports a snapshot of the document as it existed at the given frontiers.

func SnapshotMode added in v0.4.0

func SnapshotMode() ExportMode

SnapshotMode returns an ExportMode that exports a full snapshot of the document, including its complete history.

bytes, err := doc.Export(loro.SnapshotMode())

func StateOnlyMode added in v0.4.0

func StateOnlyMode(frontiers *Frontiers) ExportMode

StateOnlyMode returns an ExportMode that exports only the state at the given frontiers, without history. Pass nil to export the current state.

func UpdatesInRangeMode added in v0.4.0

func UpdatesInRangeMode(spans []IdSpan) ExportMode

UpdatesInRangeMode returns an ExportMode that exports the updates within the given id spans.

func UpdatesMode added in v0.4.0

func UpdatesMode(from *VersionVector) ExportMode

UpdatesMode returns an ExportMode that exports updates not present in the given version vector. Pass the remote peer's VersionVector to produce a delta suitable for incremental sync.

bytes, err := doc.Export(loro.UpdatesMode(remoteVV))

type ExportModeShallowSnapshot added in v0.3.0

type ExportModeShallowSnapshot struct {
	Frontiers *Frontiers
}

func (ExportModeShallowSnapshot) Destroy added in v0.3.0

func (e ExportModeShallowSnapshot) Destroy()

type ExportModeSnapshot added in v0.3.0

type ExportModeSnapshot struct {
}

func (ExportModeSnapshot) Destroy added in v0.3.0

func (e ExportModeSnapshot) Destroy()

type ExportModeSnapshotAt added in v0.3.0

type ExportModeSnapshotAt struct {
	Frontiers *Frontiers
}

func (ExportModeSnapshotAt) Destroy added in v0.3.0

func (e ExportModeSnapshotAt) Destroy()

type ExportModeStateOnly added in v0.3.0

type ExportModeStateOnly struct {
	Frontiers **Frontiers
}

func (ExportModeStateOnly) Destroy added in v0.3.0

func (e ExportModeStateOnly) Destroy()

type ExportModeUpdates added in v0.3.0

type ExportModeUpdates struct {
	From *VersionVector
}

func (ExportModeUpdates) Destroy added in v0.3.0

func (e ExportModeUpdates) Destroy()

type ExportModeUpdatesInRange added in v0.3.0

type ExportModeUpdatesInRange struct {
	Spans []IdSpan
}

func (ExportModeUpdatesInRange) Destroy added in v0.3.0

func (e ExportModeUpdatesInRange) Destroy()

type ExternalCRustBuffer added in v0.3.0

type ExternalCRustBuffer interface {
	Data() unsafe.Pointer
	Len() uint64
	Capacity() uint64
}

C.RustBuffer fields exposed as an interface so they can be accessed in different Go packages. See https://github.com/golang/go/issues/13467

func RustBufferFromC added in v0.3.0

func RustBufferFromC(b C.RustBuffer) ExternalCRustBuffer

type FfiConverterAbsolutePosition

type FfiConverterAbsolutePosition struct{}

func (FfiConverterAbsolutePosition) Lift

func (FfiConverterAbsolutePosition) Lower

func (FfiConverterAbsolutePosition) LowerExternal added in v0.3.0

func (FfiConverterAbsolutePosition) Read

func (FfiConverterAbsolutePosition) Write

func (c FfiConverterAbsolutePosition) Write(writer io.Writer, value AbsolutePosition)

type FfiConverterAwareness

type FfiConverterAwareness struct{}

func (FfiConverterAwareness) Lift

func (c FfiConverterAwareness) Lift(handle C.uint64_t) *Awareness

func (FfiConverterAwareness) Lower

func (c FfiConverterAwareness) Lower(value *Awareness) C.uint64_t

func (FfiConverterAwareness) Read

func (c FfiConverterAwareness) Read(reader io.Reader) *Awareness

func (FfiConverterAwareness) Write

func (c FfiConverterAwareness) Write(writer io.Writer, value *Awareness)

type FfiConverterAwarenessPeerUpdate

type FfiConverterAwarenessPeerUpdate struct{}

func (FfiConverterAwarenessPeerUpdate) Lift

func (FfiConverterAwarenessPeerUpdate) Lower

func (FfiConverterAwarenessPeerUpdate) LowerExternal added in v0.3.0

func (FfiConverterAwarenessPeerUpdate) Read

func (FfiConverterAwarenessPeerUpdate) Write

type FfiConverterBool

type FfiConverterBool struct{}

func (FfiConverterBool) Lift

func (FfiConverterBool) Lift(value C.int8_t) bool

func (FfiConverterBool) Lower

func (FfiConverterBool) Lower(value bool) C.int8_t

func (FfiConverterBool) Read

func (FfiConverterBool) Read(reader io.Reader) bool

func (FfiConverterBool) Write

func (FfiConverterBool) Write(writer io.Writer, value bool)

type FfiConverterBytes

type FfiConverterBytes struct{}

func (FfiConverterBytes) Lift

func (c FfiConverterBytes) Lift(rb RustBufferI) []byte

func (FfiConverterBytes) Lower

func (c FfiConverterBytes) Lower(value []byte) C.RustBuffer

func (FfiConverterBytes) LowerExternal added in v0.3.0

func (c FfiConverterBytes) LowerExternal(value []byte) ExternalCRustBuffer

func (FfiConverterBytes) Read

func (c FfiConverterBytes) Read(reader io.Reader) []byte

func (FfiConverterBytes) Write

func (c FfiConverterBytes) Write(writer io.Writer, value []byte)

type FfiConverterCannotFindRelativePosition

type FfiConverterCannotFindRelativePosition struct{}

func (FfiConverterCannotFindRelativePosition) Lift

func (FfiConverterCannotFindRelativePosition) Lower

func (FfiConverterCannotFindRelativePosition) LowerExternal added in v0.3.0

func (FfiConverterCannotFindRelativePosition) Read

func (FfiConverterCannotFindRelativePosition) Write

type FfiConverterChangeAncestorsTraveler

type FfiConverterChangeAncestorsTraveler struct {
	// contains filtered or unexported fields
}

func (FfiConverterChangeAncestorsTraveler) Lift

func (FfiConverterChangeAncestorsTraveler) Lower

func (FfiConverterChangeAncestorsTraveler) Read

func (FfiConverterChangeAncestorsTraveler) Write

type FfiConverterChangeMeta

type FfiConverterChangeMeta struct{}

func (FfiConverterChangeMeta) Lift

func (FfiConverterChangeMeta) Lower

func (FfiConverterChangeMeta) LowerExternal added in v0.3.0

func (c FfiConverterChangeMeta) LowerExternal(value ChangeMeta) ExternalCRustBuffer

func (FfiConverterChangeMeta) Read

func (c FfiConverterChangeMeta) Read(reader io.Reader) ChangeMeta

func (FfiConverterChangeMeta) Write

func (c FfiConverterChangeMeta) Write(writer io.Writer, value ChangeMeta)

type FfiConverterChangeModifier

type FfiConverterChangeModifier struct{}

func (FfiConverterChangeModifier) Lift

func (FfiConverterChangeModifier) Lower

func (FfiConverterChangeModifier) Read

func (FfiConverterChangeModifier) Write

func (c FfiConverterChangeModifier) Write(writer io.Writer, value *ChangeModifier)

type FfiConverterChangeTravelError

type FfiConverterChangeTravelError struct{}

func (FfiConverterChangeTravelError) Lift

func (FfiConverterChangeTravelError) Lower

func (FfiConverterChangeTravelError) LowerExternal added in v0.3.0

func (FfiConverterChangeTravelError) Read

func (FfiConverterChangeTravelError) Write

func (c FfiConverterChangeTravelError) Write(writer io.Writer, value *ChangeTravelError)

type FfiConverterCommitOptions

type FfiConverterCommitOptions struct{}

func (FfiConverterCommitOptions) Lift

func (FfiConverterCommitOptions) Lower

func (FfiConverterCommitOptions) LowerExternal added in v0.3.0

func (FfiConverterCommitOptions) Read

func (FfiConverterCommitOptions) Write

func (c FfiConverterCommitOptions) Write(writer io.Writer, value CommitOptions)

type FfiConverterConfigure

type FfiConverterConfigure struct{}

func (FfiConverterConfigure) Lift

func (c FfiConverterConfigure) Lift(handle C.uint64_t) *Configure

func (FfiConverterConfigure) Lower

func (c FfiConverterConfigure) Lower(value *Configure) C.uint64_t

func (FfiConverterConfigure) Read

func (c FfiConverterConfigure) Read(reader io.Reader) *Configure

func (FfiConverterConfigure) Write

func (c FfiConverterConfigure) Write(writer io.Writer, value *Configure)

type FfiConverterContainerDiff

type FfiConverterContainerDiff struct{}

func (FfiConverterContainerDiff) Lift

func (FfiConverterContainerDiff) Lower

func (FfiConverterContainerDiff) LowerExternal added in v0.3.0

func (FfiConverterContainerDiff) Read

func (FfiConverterContainerDiff) Write

func (c FfiConverterContainerDiff) Write(writer io.Writer, value ContainerDiff)

type FfiConverterContainerId

type FfiConverterContainerId struct{}

func (FfiConverterContainerId) Lift

func (FfiConverterContainerId) Lower

func (FfiConverterContainerId) LowerExternal added in v0.3.0

func (FfiConverterContainerId) Read

func (FfiConverterContainerId) Write

func (FfiConverterContainerId) Write(writer io.Writer, value ContainerId)

type FfiConverterContainerIdAndDiff

type FfiConverterContainerIdAndDiff struct{}

func (FfiConverterContainerIdAndDiff) Lift

func (FfiConverterContainerIdAndDiff) Lower

func (FfiConverterContainerIdAndDiff) LowerExternal added in v0.3.0

func (FfiConverterContainerIdAndDiff) Read

func (FfiConverterContainerIdAndDiff) Write

type FfiConverterContainerIdLike

type FfiConverterContainerIdLike struct {
	// contains filtered or unexported fields
}

func (FfiConverterContainerIdLike) Lift

func (FfiConverterContainerIdLike) Lower

func (FfiConverterContainerIdLike) Read

func (FfiConverterContainerIdLike) Write

func (c FfiConverterContainerIdLike) Write(writer io.Writer, value ContainerIdLike)

type FfiConverterContainerPath

type FfiConverterContainerPath struct{}

func (FfiConverterContainerPath) Lift

func (FfiConverterContainerPath) Lower

func (FfiConverterContainerPath) LowerExternal added in v0.3.0

func (FfiConverterContainerPath) Read

func (FfiConverterContainerPath) Write

func (c FfiConverterContainerPath) Write(writer io.Writer, value ContainerPath)

type FfiConverterContainerType

type FfiConverterContainerType struct{}

func (FfiConverterContainerType) Lift

func (FfiConverterContainerType) Lower

func (FfiConverterContainerType) LowerExternal added in v0.3.0

func (FfiConverterContainerType) Read

func (FfiConverterContainerType) Write

func (FfiConverterContainerType) Write(writer io.Writer, value ContainerType)

type FfiConverterCounterSpan

type FfiConverterCounterSpan struct{}

func (FfiConverterCounterSpan) Lift

func (FfiConverterCounterSpan) Lower

func (FfiConverterCounterSpan) LowerExternal added in v0.3.0

func (FfiConverterCounterSpan) Read

func (FfiConverterCounterSpan) Write

func (c FfiConverterCounterSpan) Write(writer io.Writer, value CounterSpan)

type FfiConverterCursor

type FfiConverterCursor struct{}

func (FfiConverterCursor) Lift

func (c FfiConverterCursor) Lift(handle C.uint64_t) *Cursor

func (FfiConverterCursor) Lower

func (c FfiConverterCursor) Lower(value *Cursor) C.uint64_t

func (FfiConverterCursor) Read

func (c FfiConverterCursor) Read(reader io.Reader) *Cursor

func (FfiConverterCursor) Write

func (c FfiConverterCursor) Write(writer io.Writer, value *Cursor)

type FfiConverterCursorWithPos

type FfiConverterCursorWithPos struct{}

func (FfiConverterCursorWithPos) Lift

func (FfiConverterCursorWithPos) Lower

func (FfiConverterCursorWithPos) LowerExternal added in v0.3.0

func (FfiConverterCursorWithPos) Read

func (FfiConverterCursorWithPos) Write

func (c FfiConverterCursorWithPos) Write(writer io.Writer, value CursorWithPos)

type FfiConverterDiff

type FfiConverterDiff struct{}

func (FfiConverterDiff) Lift

func (c FfiConverterDiff) Lift(rb RustBufferI) Diff

func (FfiConverterDiff) Lower

func (c FfiConverterDiff) Lower(value Diff) C.RustBuffer

func (FfiConverterDiff) LowerExternal added in v0.3.0

func (c FfiConverterDiff) LowerExternal(value Diff) ExternalCRustBuffer

func (FfiConverterDiff) Read

func (FfiConverterDiff) Read(reader io.Reader) Diff

func (FfiConverterDiff) Write

func (FfiConverterDiff) Write(writer io.Writer, value Diff)

type FfiConverterDiffBatch

type FfiConverterDiffBatch struct{}

func (FfiConverterDiffBatch) Lift

func (c FfiConverterDiffBatch) Lift(handle C.uint64_t) *DiffBatch

func (FfiConverterDiffBatch) Lower

func (c FfiConverterDiffBatch) Lower(value *DiffBatch) C.uint64_t

func (FfiConverterDiffBatch) Read

func (c FfiConverterDiffBatch) Read(reader io.Reader) *DiffBatch

func (FfiConverterDiffBatch) Write

func (c FfiConverterDiffBatch) Write(writer io.Writer, value *DiffBatch)

type FfiConverterDiffEvent

type FfiConverterDiffEvent struct{}

func (FfiConverterDiffEvent) Lift

func (FfiConverterDiffEvent) Lower

func (FfiConverterDiffEvent) LowerExternal added in v0.3.0

func (c FfiConverterDiffEvent) LowerExternal(value DiffEvent) ExternalCRustBuffer

func (FfiConverterDiffEvent) Read

func (c FfiConverterDiffEvent) Read(reader io.Reader) DiffEvent

func (FfiConverterDiffEvent) Write

func (c FfiConverterDiffEvent) Write(writer io.Writer, value DiffEvent)

type FfiConverterEphemeralEventTrigger

type FfiConverterEphemeralEventTrigger struct{}

func (FfiConverterEphemeralEventTrigger) Lift

func (FfiConverterEphemeralEventTrigger) Lower

func (FfiConverterEphemeralEventTrigger) LowerExternal added in v0.3.0

func (FfiConverterEphemeralEventTrigger) Read

func (FfiConverterEphemeralEventTrigger) Write

type FfiConverterEphemeralStore

type FfiConverterEphemeralStore struct{}

func (FfiConverterEphemeralStore) Lift

func (FfiConverterEphemeralStore) Lower

func (FfiConverterEphemeralStore) Read

func (FfiConverterEphemeralStore) Write

func (c FfiConverterEphemeralStore) Write(writer io.Writer, value *EphemeralStore)

type FfiConverterEphemeralStoreEvent

type FfiConverterEphemeralStoreEvent struct{}

func (FfiConverterEphemeralStoreEvent) Lift

func (FfiConverterEphemeralStoreEvent) Lower

func (FfiConverterEphemeralStoreEvent) LowerExternal added in v0.3.0

func (FfiConverterEphemeralStoreEvent) Read

func (FfiConverterEphemeralStoreEvent) Write

type FfiConverterEphemeralSubscriber

type FfiConverterEphemeralSubscriber struct {
	// contains filtered or unexported fields
}

func (FfiConverterEphemeralSubscriber) Lift

func (FfiConverterEphemeralSubscriber) Lower

func (FfiConverterEphemeralSubscriber) Read

func (FfiConverterEphemeralSubscriber) Write

type FfiConverterEventTriggerKind

type FfiConverterEventTriggerKind struct{}

func (FfiConverterEventTriggerKind) Lift

func (FfiConverterEventTriggerKind) Lower

func (FfiConverterEventTriggerKind) LowerExternal added in v0.3.0

func (FfiConverterEventTriggerKind) Read

func (FfiConverterEventTriggerKind) Write

type FfiConverterExpandType

type FfiConverterExpandType struct{}

func (FfiConverterExpandType) Lift

func (FfiConverterExpandType) Lower

func (FfiConverterExpandType) LowerExternal added in v0.3.0

func (c FfiConverterExpandType) LowerExternal(value ExpandType) ExternalCRustBuffer

func (FfiConverterExpandType) Read

func (FfiConverterExpandType) Write

func (FfiConverterExpandType) Write(writer io.Writer, value ExpandType)

type FfiConverterExportMode added in v0.3.0

type FfiConverterExportMode struct{}

func (FfiConverterExportMode) Lift added in v0.3.0

func (FfiConverterExportMode) Lower added in v0.3.0

func (FfiConverterExportMode) LowerExternal added in v0.3.0

func (c FfiConverterExportMode) LowerExternal(value ExportMode) ExternalCRustBuffer

func (FfiConverterExportMode) Read added in v0.3.0

func (FfiConverterExportMode) Write added in v0.3.0

func (FfiConverterExportMode) Write(writer io.Writer, value ExportMode)

type FfiConverterFirstCommitFromPeerCallback

type FfiConverterFirstCommitFromPeerCallback struct {
	// contains filtered or unexported fields
}

func (FfiConverterFirstCommitFromPeerCallback) Lift

func (FfiConverterFirstCommitFromPeerCallback) Lower

func (FfiConverterFirstCommitFromPeerCallback) Read

func (FfiConverterFirstCommitFromPeerCallback) Write

type FfiConverterFirstCommitFromPeerPayload

type FfiConverterFirstCommitFromPeerPayload struct{}

func (FfiConverterFirstCommitFromPeerPayload) Lift

func (FfiConverterFirstCommitFromPeerPayload) Lower

func (FfiConverterFirstCommitFromPeerPayload) LowerExternal added in v0.3.0

func (FfiConverterFirstCommitFromPeerPayload) Read

func (FfiConverterFirstCommitFromPeerPayload) Write

type FfiConverterFloat64

type FfiConverterFloat64 struct{}

func (FfiConverterFloat64) Lift

func (FfiConverterFloat64) Lift(value C.double) float64

func (FfiConverterFloat64) Lower

func (FfiConverterFloat64) Lower(value float64) C.double

func (FfiConverterFloat64) Read

func (FfiConverterFloat64) Read(reader io.Reader) float64

func (FfiConverterFloat64) Write

func (FfiConverterFloat64) Write(writer io.Writer, value float64)

type FfiConverterFractionalIndex

type FfiConverterFractionalIndex struct{}

func (FfiConverterFractionalIndex) Lift

func (FfiConverterFractionalIndex) Lower

func (FfiConverterFractionalIndex) Read

func (FfiConverterFractionalIndex) Write

func (c FfiConverterFractionalIndex) Write(writer io.Writer, value *FractionalIndex)

type FfiConverterFrontiers

type FfiConverterFrontiers struct{}

func (FfiConverterFrontiers) Lift

func (c FfiConverterFrontiers) Lift(handle C.uint64_t) *Frontiers

func (FfiConverterFrontiers) Lower

func (c FfiConverterFrontiers) Lower(value *Frontiers) C.uint64_t

func (FfiConverterFrontiers) Read

func (c FfiConverterFrontiers) Read(reader io.Reader) *Frontiers

func (FfiConverterFrontiers) Write

func (c FfiConverterFrontiers) Write(writer io.Writer, value *Frontiers)

type FfiConverterFrontiersOrId

type FfiConverterFrontiersOrId struct{}

func (FfiConverterFrontiersOrId) Lift

func (FfiConverterFrontiersOrId) Lower

func (FfiConverterFrontiersOrId) LowerExternal added in v0.3.0

func (FfiConverterFrontiersOrId) Read

func (FfiConverterFrontiersOrId) Write

func (c FfiConverterFrontiersOrId) Write(writer io.Writer, value FrontiersOrId)

type FfiConverterId

type FfiConverterId struct{}

func (FfiConverterId) Lift

func (c FfiConverterId) Lift(rb RustBufferI) Id

func (FfiConverterId) Lower

func (c FfiConverterId) Lower(value Id) C.RustBuffer

func (FfiConverterId) LowerExternal added in v0.3.0

func (c FfiConverterId) LowerExternal(value Id) ExternalCRustBuffer

func (FfiConverterId) Read

func (c FfiConverterId) Read(reader io.Reader) Id

func (FfiConverterId) Write

func (c FfiConverterId) Write(writer io.Writer, value Id)

type FfiConverterIdLp

type FfiConverterIdLp struct{}

func (FfiConverterIdLp) Lift

func (c FfiConverterIdLp) Lift(rb RustBufferI) IdLp

func (FfiConverterIdLp) Lower

func (c FfiConverterIdLp) Lower(value IdLp) C.RustBuffer

func (FfiConverterIdLp) LowerExternal added in v0.3.0

func (c FfiConverterIdLp) LowerExternal(value IdLp) ExternalCRustBuffer

func (FfiConverterIdLp) Read

func (c FfiConverterIdLp) Read(reader io.Reader) IdLp

func (FfiConverterIdLp) Write

func (c FfiConverterIdLp) Write(writer io.Writer, value IdLp)

type FfiConverterIdSpan

type FfiConverterIdSpan struct{}

func (FfiConverterIdSpan) Lift

func (FfiConverterIdSpan) Lower

func (c FfiConverterIdSpan) Lower(value IdSpan) C.RustBuffer

func (FfiConverterIdSpan) LowerExternal added in v0.3.0

func (c FfiConverterIdSpan) LowerExternal(value IdSpan) ExternalCRustBuffer

func (FfiConverterIdSpan) Read

func (c FfiConverterIdSpan) Read(reader io.Reader) IdSpan

func (FfiConverterIdSpan) Write

func (c FfiConverterIdSpan) Write(writer io.Writer, value IdSpan)

type FfiConverterImportBlobMetadata

type FfiConverterImportBlobMetadata struct{}

func (FfiConverterImportBlobMetadata) Lift

func (FfiConverterImportBlobMetadata) Lower

func (FfiConverterImportBlobMetadata) LowerExternal added in v0.3.0

func (FfiConverterImportBlobMetadata) Read

func (FfiConverterImportBlobMetadata) Write

type FfiConverterImportStatus

type FfiConverterImportStatus struct{}

func (FfiConverterImportStatus) Lift

func (FfiConverterImportStatus) Lower

func (FfiConverterImportStatus) LowerExternal added in v0.3.0

func (FfiConverterImportStatus) Read

func (FfiConverterImportStatus) Write

func (c FfiConverterImportStatus) Write(writer io.Writer, value ImportStatus)

type FfiConverterIndex

type FfiConverterIndex struct{}

func (FfiConverterIndex) Lift

func (c FfiConverterIndex) Lift(rb RustBufferI) Index

func (FfiConverterIndex) Lower

func (c FfiConverterIndex) Lower(value Index) C.RustBuffer

func (FfiConverterIndex) LowerExternal added in v0.3.0

func (c FfiConverterIndex) LowerExternal(value Index) ExternalCRustBuffer

func (FfiConverterIndex) Read

func (FfiConverterIndex) Read(reader io.Reader) Index

func (FfiConverterIndex) Write

func (FfiConverterIndex) Write(writer io.Writer, value Index)

type FfiConverterInt32

type FfiConverterInt32 struct{}

func (FfiConverterInt32) Lift

func (FfiConverterInt32) Lift(value C.int32_t) int32

func (FfiConverterInt32) Lower

func (FfiConverterInt32) Lower(value int32) C.int32_t

func (FfiConverterInt32) Read

func (FfiConverterInt32) Read(reader io.Reader) int32

func (FfiConverterInt32) Write

func (FfiConverterInt32) Write(writer io.Writer, value int32)

type FfiConverterInt64

type FfiConverterInt64 struct{}

func (FfiConverterInt64) Lift

func (FfiConverterInt64) Lift(value C.int64_t) int64

func (FfiConverterInt64) Lower

func (FfiConverterInt64) Lower(value int64) C.int64_t

func (FfiConverterInt64) Read

func (FfiConverterInt64) Read(reader io.Reader) int64

func (FfiConverterInt64) Write

func (FfiConverterInt64) Write(writer io.Writer, value int64)

type FfiConverterJsonPathError

type FfiConverterJsonPathError struct{}

func (FfiConverterJsonPathError) Lift

func (FfiConverterJsonPathError) Lower

func (FfiConverterJsonPathError) LowerExternal added in v0.3.0

func (FfiConverterJsonPathError) Read

func (FfiConverterJsonPathError) Write

func (c FfiConverterJsonPathError) Write(writer io.Writer, value *JsonPathError)

type FfiConverterJsonPathSubscriber added in v0.2.0

type FfiConverterJsonPathSubscriber struct {
	// contains filtered or unexported fields
}

func (FfiConverterJsonPathSubscriber) Lift added in v0.2.0

func (FfiConverterJsonPathSubscriber) Lower added in v0.2.0

func (FfiConverterJsonPathSubscriber) Read added in v0.2.0

func (FfiConverterJsonPathSubscriber) Write added in v0.2.0

type FfiConverterListDiffItem

type FfiConverterListDiffItem struct{}

func (FfiConverterListDiffItem) Lift

func (FfiConverterListDiffItem) Lower

func (FfiConverterListDiffItem) LowerExternal added in v0.3.0

func (FfiConverterListDiffItem) Read

func (FfiConverterListDiffItem) Write

func (FfiConverterListDiffItem) Write(writer io.Writer, value ListDiffItem)

type FfiConverterLocalEphemeralListener

type FfiConverterLocalEphemeralListener struct {
	// contains filtered or unexported fields
}

func (FfiConverterLocalEphemeralListener) Lift

func (FfiConverterLocalEphemeralListener) Lower

func (FfiConverterLocalEphemeralListener) Read

func (FfiConverterLocalEphemeralListener) Write

type FfiConverterLocalUpdateCallback

type FfiConverterLocalUpdateCallback struct {
	// contains filtered or unexported fields
}

func (FfiConverterLocalUpdateCallback) Lift

func (FfiConverterLocalUpdateCallback) Lower

func (FfiConverterLocalUpdateCallback) Read

func (FfiConverterLocalUpdateCallback) Write

type FfiConverterLoroCounter

type FfiConverterLoroCounter struct{}

func (FfiConverterLoroCounter) Lift

func (FfiConverterLoroCounter) Lower

func (FfiConverterLoroCounter) Read

func (c FfiConverterLoroCounter) Read(reader io.Reader) *LoroCounter

func (FfiConverterLoroCounter) Write

func (c FfiConverterLoroCounter) Write(writer io.Writer, value *LoroCounter)

type FfiConverterLoroDoc

type FfiConverterLoroDoc struct{}

func (FfiConverterLoroDoc) Lift

func (c FfiConverterLoroDoc) Lift(handle C.uint64_t) *LoroDoc

func (FfiConverterLoroDoc) Lower

func (c FfiConverterLoroDoc) Lower(value *LoroDoc) C.uint64_t

func (FfiConverterLoroDoc) Read

func (c FfiConverterLoroDoc) Read(reader io.Reader) *LoroDoc

func (FfiConverterLoroDoc) Write

func (c FfiConverterLoroDoc) Write(writer io.Writer, value *LoroDoc)

type FfiConverterLoroEncodeError

type FfiConverterLoroEncodeError struct{}

func (FfiConverterLoroEncodeError) Lift

func (FfiConverterLoroEncodeError) Lower

func (FfiConverterLoroEncodeError) LowerExternal added in v0.3.0

func (FfiConverterLoroEncodeError) Read

func (FfiConverterLoroEncodeError) Write

func (c FfiConverterLoroEncodeError) Write(writer io.Writer, value *LoroEncodeError)

type FfiConverterLoroError

type FfiConverterLoroError struct{}

func (FfiConverterLoroError) Lift

func (FfiConverterLoroError) Lower

func (c FfiConverterLoroError) Lower(value *LoroError) C.RustBuffer

func (FfiConverterLoroError) LowerExternal added in v0.3.0

func (c FfiConverterLoroError) LowerExternal(value *LoroError) ExternalCRustBuffer

func (FfiConverterLoroError) Read

func (c FfiConverterLoroError) Read(reader io.Reader) *LoroError

func (FfiConverterLoroError) Write

func (c FfiConverterLoroError) Write(writer io.Writer, value *LoroError)

type FfiConverterLoroList

type FfiConverterLoroList struct{}

func (FfiConverterLoroList) Lift

func (c FfiConverterLoroList) Lift(handle C.uint64_t) *LoroList

func (FfiConverterLoroList) Lower

func (c FfiConverterLoroList) Lower(value *LoroList) C.uint64_t

func (FfiConverterLoroList) Read

func (c FfiConverterLoroList) Read(reader io.Reader) *LoroList

func (FfiConverterLoroList) Write

func (c FfiConverterLoroList) Write(writer io.Writer, value *LoroList)

type FfiConverterLoroMap

type FfiConverterLoroMap struct{}

func (FfiConverterLoroMap) Lift

func (c FfiConverterLoroMap) Lift(handle C.uint64_t) *LoroMap

func (FfiConverterLoroMap) Lower

func (c FfiConverterLoroMap) Lower(value *LoroMap) C.uint64_t

func (FfiConverterLoroMap) Read

func (c FfiConverterLoroMap) Read(reader io.Reader) *LoroMap

func (FfiConverterLoroMap) Write

func (c FfiConverterLoroMap) Write(writer io.Writer, value *LoroMap)

type FfiConverterLoroMovableList

type FfiConverterLoroMovableList struct{}

func (FfiConverterLoroMovableList) Lift

func (FfiConverterLoroMovableList) Lower

func (FfiConverterLoroMovableList) Read

func (FfiConverterLoroMovableList) Write

func (c FfiConverterLoroMovableList) Write(writer io.Writer, value *LoroMovableList)

type FfiConverterLoroText

type FfiConverterLoroText struct{}

func (FfiConverterLoroText) Lift

func (c FfiConverterLoroText) Lift(handle C.uint64_t) *LoroText

func (FfiConverterLoroText) Lower

func (c FfiConverterLoroText) Lower(value *LoroText) C.uint64_t

func (FfiConverterLoroText) Read

func (c FfiConverterLoroText) Read(reader io.Reader) *LoroText

func (FfiConverterLoroText) Write

func (c FfiConverterLoroText) Write(writer io.Writer, value *LoroText)

type FfiConverterLoroTree

type FfiConverterLoroTree struct{}

func (FfiConverterLoroTree) Lift

func (c FfiConverterLoroTree) Lift(handle C.uint64_t) *LoroTree

func (FfiConverterLoroTree) Lower

func (c FfiConverterLoroTree) Lower(value *LoroTree) C.uint64_t

func (FfiConverterLoroTree) Read

func (c FfiConverterLoroTree) Read(reader io.Reader) *LoroTree

func (FfiConverterLoroTree) Write

func (c FfiConverterLoroTree) Write(writer io.Writer, value *LoroTree)

type FfiConverterLoroUnknown

type FfiConverterLoroUnknown struct{}

func (FfiConverterLoroUnknown) Lift

func (FfiConverterLoroUnknown) Lower

func (FfiConverterLoroUnknown) Read

func (c FfiConverterLoroUnknown) Read(reader io.Reader) *LoroUnknown

func (FfiConverterLoroUnknown) Write

func (c FfiConverterLoroUnknown) Write(writer io.Writer, value *LoroUnknown)

type FfiConverterLoroValue

type FfiConverterLoroValue struct{}

func (FfiConverterLoroValue) Lift

func (FfiConverterLoroValue) Lower

func (FfiConverterLoroValue) LowerExternal added in v0.3.0

func (c FfiConverterLoroValue) LowerExternal(value LoroValue) ExternalCRustBuffer

func (FfiConverterLoroValue) Read

func (FfiConverterLoroValue) Write

func (FfiConverterLoroValue) Write(writer io.Writer, value LoroValue)

type FfiConverterLoroValueLike

type FfiConverterLoroValueLike struct {
	// contains filtered or unexported fields
}

func (FfiConverterLoroValueLike) Lift

func (FfiConverterLoroValueLike) Lower

func (FfiConverterLoroValueLike) Read

func (FfiConverterLoroValueLike) Write

func (c FfiConverterLoroValueLike) Write(writer io.Writer, value LoroValueLike)

type FfiConverterMapDelta

type FfiConverterMapDelta struct{}

func (FfiConverterMapDelta) Lift

func (FfiConverterMapDelta) Lower

func (c FfiConverterMapDelta) Lower(value MapDelta) C.RustBuffer

func (FfiConverterMapDelta) LowerExternal added in v0.3.0

func (c FfiConverterMapDelta) LowerExternal(value MapDelta) ExternalCRustBuffer

func (FfiConverterMapDelta) Read

func (c FfiConverterMapDelta) Read(reader io.Reader) MapDelta

func (FfiConverterMapDelta) Write

func (c FfiConverterMapDelta) Write(writer io.Writer, value MapDelta)

type FfiConverterMapStringLoroValue

type FfiConverterMapStringLoroValue struct{}

func (FfiConverterMapStringLoroValue) Lift

func (FfiConverterMapStringLoroValue) Lower

func (FfiConverterMapStringLoroValue) LowerExternal added in v0.3.0

func (FfiConverterMapStringLoroValue) Read

func (FfiConverterMapStringLoroValue) Write

func (_ FfiConverterMapStringLoroValue) Write(writer io.Writer, mapValue map[string]LoroValue)

type FfiConverterMapStringOptionalValueOrContainer

type FfiConverterMapStringOptionalValueOrContainer struct{}

func (FfiConverterMapStringOptionalValueOrContainer) Lift

func (FfiConverterMapStringOptionalValueOrContainer) Lower

func (FfiConverterMapStringOptionalValueOrContainer) LowerExternal added in v0.3.0

func (FfiConverterMapStringOptionalValueOrContainer) Read

func (FfiConverterMapStringOptionalValueOrContainer) Write

type FfiConverterMapUint64CounterSpan

type FfiConverterMapUint64CounterSpan struct{}

func (FfiConverterMapUint64CounterSpan) Lift

func (FfiConverterMapUint64CounterSpan) Lower

func (FfiConverterMapUint64CounterSpan) LowerExternal added in v0.3.0

func (FfiConverterMapUint64CounterSpan) Read

func (FfiConverterMapUint64CounterSpan) Write

func (_ FfiConverterMapUint64CounterSpan) Write(writer io.Writer, mapValue map[uint64]CounterSpan)

type FfiConverterMapUint64Int32

type FfiConverterMapUint64Int32 struct{}

func (FfiConverterMapUint64Int32) Lift

func (FfiConverterMapUint64Int32) Lower

func (c FfiConverterMapUint64Int32) Lower(value map[uint64]int32) C.RustBuffer

func (FfiConverterMapUint64Int32) LowerExternal added in v0.3.0

func (c FfiConverterMapUint64Int32) LowerExternal(value map[uint64]int32) ExternalCRustBuffer

func (FfiConverterMapUint64Int32) Read

func (_ FfiConverterMapUint64Int32) Read(reader io.Reader) map[uint64]int32

func (FfiConverterMapUint64Int32) Write

func (_ FfiConverterMapUint64Int32) Write(writer io.Writer, mapValue map[uint64]int32)

type FfiConverterMapUint64PeerInfo

type FfiConverterMapUint64PeerInfo struct{}

func (FfiConverterMapUint64PeerInfo) Lift

func (FfiConverterMapUint64PeerInfo) Lower

func (FfiConverterMapUint64PeerInfo) LowerExternal added in v0.3.0

func (FfiConverterMapUint64PeerInfo) Read

func (FfiConverterMapUint64PeerInfo) Write

func (_ FfiConverterMapUint64PeerInfo) Write(writer io.Writer, mapValue map[uint64]PeerInfo)

type FfiConverterOnPop

type FfiConverterOnPop struct {
	// contains filtered or unexported fields
}

func (FfiConverterOnPop) Lift

func (c FfiConverterOnPop) Lift(handle C.uint64_t) OnPop

func (FfiConverterOnPop) Lower

func (c FfiConverterOnPop) Lower(value OnPop) C.uint64_t

func (FfiConverterOnPop) Read

func (c FfiConverterOnPop) Read(reader io.Reader) OnPop

func (FfiConverterOnPop) Write

func (c FfiConverterOnPop) Write(writer io.Writer, value OnPop)

type FfiConverterOnPush

type FfiConverterOnPush struct {
	// contains filtered or unexported fields
}

func (FfiConverterOnPush) Lift

func (c FfiConverterOnPush) Lift(handle C.uint64_t) OnPush

func (FfiConverterOnPush) Lower

func (c FfiConverterOnPush) Lower(value OnPush) C.uint64_t

func (FfiConverterOnPush) Read

func (c FfiConverterOnPush) Read(reader io.Reader) OnPush

func (FfiConverterOnPush) Write

func (c FfiConverterOnPush) Write(writer io.Writer, value OnPush)

type FfiConverterOptionalChangeMeta

type FfiConverterOptionalChangeMeta struct{}

func (FfiConverterOptionalChangeMeta) Lift

func (FfiConverterOptionalChangeMeta) Lower

func (FfiConverterOptionalChangeMeta) LowerExternal added in v0.3.0

func (FfiConverterOptionalChangeMeta) Read

func (FfiConverterOptionalChangeMeta) Write

func (_ FfiConverterOptionalChangeMeta) Write(writer io.Writer, value *ChangeMeta)

type FfiConverterOptionalContainerId

type FfiConverterOptionalContainerId struct{}

func (FfiConverterOptionalContainerId) Lift

func (FfiConverterOptionalContainerId) Lower

func (FfiConverterOptionalContainerId) LowerExternal added in v0.3.0

func (FfiConverterOptionalContainerId) Read

func (FfiConverterOptionalContainerId) Write

func (_ FfiConverterOptionalContainerId) Write(writer io.Writer, value *ContainerId)

type FfiConverterOptionalContainerType

type FfiConverterOptionalContainerType struct{}

func (FfiConverterOptionalContainerType) Lift

func (FfiConverterOptionalContainerType) Lower

func (FfiConverterOptionalContainerType) LowerExternal added in v0.3.0

func (FfiConverterOptionalContainerType) Read

func (FfiConverterOptionalContainerType) Write

func (_ FfiConverterOptionalContainerType) Write(writer io.Writer, value *ContainerType)

type FfiConverterOptionalCounterSpan

type FfiConverterOptionalCounterSpan struct{}

func (FfiConverterOptionalCounterSpan) Lift

func (FfiConverterOptionalCounterSpan) Lower

func (FfiConverterOptionalCounterSpan) LowerExternal added in v0.3.0

func (FfiConverterOptionalCounterSpan) Read

func (FfiConverterOptionalCounterSpan) Write

func (_ FfiConverterOptionalCounterSpan) Write(writer io.Writer, value *CounterSpan)

type FfiConverterOptionalCursor

type FfiConverterOptionalCursor struct{}

func (FfiConverterOptionalCursor) Lift

func (FfiConverterOptionalCursor) Lower

func (c FfiConverterOptionalCursor) Lower(value **Cursor) C.RustBuffer

func (FfiConverterOptionalCursor) LowerExternal added in v0.3.0

func (c FfiConverterOptionalCursor) LowerExternal(value **Cursor) ExternalCRustBuffer

func (FfiConverterOptionalCursor) Read

func (_ FfiConverterOptionalCursor) Read(reader io.Reader) **Cursor

func (FfiConverterOptionalCursor) Write

func (_ FfiConverterOptionalCursor) Write(writer io.Writer, value **Cursor)

type FfiConverterOptionalDiff

type FfiConverterOptionalDiff struct{}

func (FfiConverterOptionalDiff) Lift

func (FfiConverterOptionalDiff) Lower

func (c FfiConverterOptionalDiff) Lower(value *Diff) C.RustBuffer

func (FfiConverterOptionalDiff) LowerExternal added in v0.3.0

func (c FfiConverterOptionalDiff) LowerExternal(value *Diff) ExternalCRustBuffer

func (FfiConverterOptionalDiff) Read

func (_ FfiConverterOptionalDiff) Read(reader io.Reader) *Diff

func (FfiConverterOptionalDiff) Write

func (_ FfiConverterOptionalDiff) Write(writer io.Writer, value *Diff)

type FfiConverterOptionalDiffEvent

type FfiConverterOptionalDiffEvent struct{}

func (FfiConverterOptionalDiffEvent) Lift

func (FfiConverterOptionalDiffEvent) Lower

func (FfiConverterOptionalDiffEvent) LowerExternal added in v0.3.0

func (FfiConverterOptionalDiffEvent) Read

func (FfiConverterOptionalDiffEvent) Write

func (_ FfiConverterOptionalDiffEvent) Write(writer io.Writer, value *DiffEvent)

type FfiConverterOptionalFloat64

type FfiConverterOptionalFloat64 struct{}

func (FfiConverterOptionalFloat64) Lift

func (FfiConverterOptionalFloat64) Lower

func (FfiConverterOptionalFloat64) LowerExternal added in v0.3.0

func (FfiConverterOptionalFloat64) Read

func (_ FfiConverterOptionalFloat64) Read(reader io.Reader) *float64

func (FfiConverterOptionalFloat64) Write

func (_ FfiConverterOptionalFloat64) Write(writer io.Writer, value *float64)

type FfiConverterOptionalFrontiers

type FfiConverterOptionalFrontiers struct{}

func (FfiConverterOptionalFrontiers) Lift

func (FfiConverterOptionalFrontiers) Lower

func (FfiConverterOptionalFrontiers) LowerExternal added in v0.3.0

func (FfiConverterOptionalFrontiers) Read

func (FfiConverterOptionalFrontiers) Write

func (_ FfiConverterOptionalFrontiers) Write(writer io.Writer, value **Frontiers)

type FfiConverterOptionalId

type FfiConverterOptionalId struct{}

func (FfiConverterOptionalId) Lift

func (FfiConverterOptionalId) Lower

func (c FfiConverterOptionalId) Lower(value *Id) C.RustBuffer

func (FfiConverterOptionalId) LowerExternal added in v0.3.0

func (c FfiConverterOptionalId) LowerExternal(value *Id) ExternalCRustBuffer

func (FfiConverterOptionalId) Read

func (_ FfiConverterOptionalId) Read(reader io.Reader) *Id

func (FfiConverterOptionalId) Write

func (_ FfiConverterOptionalId) Write(writer io.Writer, value *Id)

type FfiConverterOptionalInt32

type FfiConverterOptionalInt32 struct{}

func (FfiConverterOptionalInt32) Lift

func (FfiConverterOptionalInt32) Lower

func (c FfiConverterOptionalInt32) Lower(value *int32) C.RustBuffer

func (FfiConverterOptionalInt32) LowerExternal added in v0.3.0

func (c FfiConverterOptionalInt32) LowerExternal(value *int32) ExternalCRustBuffer

func (FfiConverterOptionalInt32) Read

func (_ FfiConverterOptionalInt32) Read(reader io.Reader) *int32

func (FfiConverterOptionalInt32) Write

func (_ FfiConverterOptionalInt32) Write(writer io.Writer, value *int32)

type FfiConverterOptionalInt64

type FfiConverterOptionalInt64 struct{}

func (FfiConverterOptionalInt64) Lift

func (FfiConverterOptionalInt64) Lower

func (c FfiConverterOptionalInt64) Lower(value *int64) C.RustBuffer

func (FfiConverterOptionalInt64) LowerExternal added in v0.3.0

func (c FfiConverterOptionalInt64) LowerExternal(value *int64) ExternalCRustBuffer

func (FfiConverterOptionalInt64) Read

func (_ FfiConverterOptionalInt64) Read(reader io.Reader) *int64

func (FfiConverterOptionalInt64) Write

func (_ FfiConverterOptionalInt64) Write(writer io.Writer, value *int64)

type FfiConverterOptionalLoroCounter

type FfiConverterOptionalLoroCounter struct{}

func (FfiConverterOptionalLoroCounter) Lift

func (FfiConverterOptionalLoroCounter) Lower

func (FfiConverterOptionalLoroCounter) LowerExternal added in v0.3.0

func (FfiConverterOptionalLoroCounter) Read

func (FfiConverterOptionalLoroCounter) Write

func (_ FfiConverterOptionalLoroCounter) Write(writer io.Writer, value **LoroCounter)

type FfiConverterOptionalLoroDoc

type FfiConverterOptionalLoroDoc struct{}

func (FfiConverterOptionalLoroDoc) Lift

func (FfiConverterOptionalLoroDoc) Lower

func (FfiConverterOptionalLoroDoc) LowerExternal added in v0.3.0

func (c FfiConverterOptionalLoroDoc) LowerExternal(value **LoroDoc) ExternalCRustBuffer

func (FfiConverterOptionalLoroDoc) Read

func (_ FfiConverterOptionalLoroDoc) Read(reader io.Reader) **LoroDoc

func (FfiConverterOptionalLoroDoc) Write

func (_ FfiConverterOptionalLoroDoc) Write(writer io.Writer, value **LoroDoc)

type FfiConverterOptionalLoroList

type FfiConverterOptionalLoroList struct{}

func (FfiConverterOptionalLoroList) Lift

func (FfiConverterOptionalLoroList) Lower

func (FfiConverterOptionalLoroList) LowerExternal added in v0.3.0

func (FfiConverterOptionalLoroList) Read

func (FfiConverterOptionalLoroList) Write

func (_ FfiConverterOptionalLoroList) Write(writer io.Writer, value **LoroList)

type FfiConverterOptionalLoroMap

type FfiConverterOptionalLoroMap struct{}

func (FfiConverterOptionalLoroMap) Lift

func (FfiConverterOptionalLoroMap) Lower

func (FfiConverterOptionalLoroMap) LowerExternal added in v0.3.0

func (c FfiConverterOptionalLoroMap) LowerExternal(value **LoroMap) ExternalCRustBuffer

func (FfiConverterOptionalLoroMap) Read

func (_ FfiConverterOptionalLoroMap) Read(reader io.Reader) **LoroMap

func (FfiConverterOptionalLoroMap) Write

func (_ FfiConverterOptionalLoroMap) Write(writer io.Writer, value **LoroMap)

type FfiConverterOptionalLoroMovableList

type FfiConverterOptionalLoroMovableList struct{}

func (FfiConverterOptionalLoroMovableList) Lift

func (FfiConverterOptionalLoroMovableList) Lower

func (FfiConverterOptionalLoroMovableList) LowerExternal added in v0.3.0

func (FfiConverterOptionalLoroMovableList) Read

func (FfiConverterOptionalLoroMovableList) Write

type FfiConverterOptionalLoroText

type FfiConverterOptionalLoroText struct{}

func (FfiConverterOptionalLoroText) Lift

func (FfiConverterOptionalLoroText) Lower

func (FfiConverterOptionalLoroText) LowerExternal added in v0.3.0

func (FfiConverterOptionalLoroText) Read

func (FfiConverterOptionalLoroText) Write

func (_ FfiConverterOptionalLoroText) Write(writer io.Writer, value **LoroText)

type FfiConverterOptionalLoroTree

type FfiConverterOptionalLoroTree struct{}

func (FfiConverterOptionalLoroTree) Lift

func (FfiConverterOptionalLoroTree) Lower

func (FfiConverterOptionalLoroTree) LowerExternal added in v0.3.0

func (FfiConverterOptionalLoroTree) Read

func (FfiConverterOptionalLoroTree) Write

func (_ FfiConverterOptionalLoroTree) Write(writer io.Writer, value **LoroTree)

type FfiConverterOptionalLoroUnknown

type FfiConverterOptionalLoroUnknown struct{}

func (FfiConverterOptionalLoroUnknown) Lift

func (FfiConverterOptionalLoroUnknown) Lower

func (FfiConverterOptionalLoroUnknown) LowerExternal added in v0.3.0

func (FfiConverterOptionalLoroUnknown) Read

func (FfiConverterOptionalLoroUnknown) Write

func (_ FfiConverterOptionalLoroUnknown) Write(writer io.Writer, value **LoroUnknown)

type FfiConverterOptionalLoroValue

type FfiConverterOptionalLoroValue struct{}

func (FfiConverterOptionalLoroValue) Lift

func (FfiConverterOptionalLoroValue) Lower

func (FfiConverterOptionalLoroValue) LowerExternal added in v0.3.0

func (FfiConverterOptionalLoroValue) Read

func (FfiConverterOptionalLoroValue) Write

func (_ FfiConverterOptionalLoroValue) Write(writer io.Writer, value *LoroValue)

type FfiConverterOptionalMapStringLoroValue

type FfiConverterOptionalMapStringLoroValue struct{}

func (FfiConverterOptionalMapStringLoroValue) Lift

func (FfiConverterOptionalMapStringLoroValue) Lower

func (FfiConverterOptionalMapStringLoroValue) LowerExternal added in v0.3.0

func (FfiConverterOptionalMapStringLoroValue) Read

func (FfiConverterOptionalMapStringLoroValue) Write

func (_ FfiConverterOptionalMapStringLoroValue) Write(writer io.Writer, value *map[string]LoroValue)

type FfiConverterOptionalMapUint64CounterSpan

type FfiConverterOptionalMapUint64CounterSpan struct{}

func (FfiConverterOptionalMapUint64CounterSpan) Lift

func (FfiConverterOptionalMapUint64CounterSpan) Lower

func (FfiConverterOptionalMapUint64CounterSpan) LowerExternal added in v0.3.0

func (FfiConverterOptionalMapUint64CounterSpan) Read

func (FfiConverterOptionalMapUint64CounterSpan) Write

type FfiConverterOptionalOnPop

type FfiConverterOptionalOnPop struct{}

func (FfiConverterOptionalOnPop) Lift

func (FfiConverterOptionalOnPop) Lower

func (c FfiConverterOptionalOnPop) Lower(value *OnPop) C.RustBuffer

func (FfiConverterOptionalOnPop) LowerExternal added in v0.3.0

func (c FfiConverterOptionalOnPop) LowerExternal(value *OnPop) ExternalCRustBuffer

func (FfiConverterOptionalOnPop) Read

func (_ FfiConverterOptionalOnPop) Read(reader io.Reader) *OnPop

func (FfiConverterOptionalOnPop) Write

func (_ FfiConverterOptionalOnPop) Write(writer io.Writer, value *OnPop)

type FfiConverterOptionalOnPush

type FfiConverterOptionalOnPush struct{}

func (FfiConverterOptionalOnPush) Lift

func (FfiConverterOptionalOnPush) Lower

func (FfiConverterOptionalOnPush) LowerExternal added in v0.3.0

func (c FfiConverterOptionalOnPush) LowerExternal(value *OnPush) ExternalCRustBuffer

func (FfiConverterOptionalOnPush) Read

func (_ FfiConverterOptionalOnPush) Read(reader io.Reader) *OnPush

func (FfiConverterOptionalOnPush) Write

func (_ FfiConverterOptionalOnPush) Write(writer io.Writer, value *OnPush)

type FfiConverterOptionalOrdering

type FfiConverterOptionalOrdering struct{}

func (FfiConverterOptionalOrdering) Lift

func (FfiConverterOptionalOrdering) Lower

func (FfiConverterOptionalOrdering) LowerExternal added in v0.3.0

func (FfiConverterOptionalOrdering) Read

func (FfiConverterOptionalOrdering) Write

func (_ FfiConverterOptionalOrdering) Write(writer io.Writer, value *Ordering)

type FfiConverterOptionalSequenceContainerPath

type FfiConverterOptionalSequenceContainerPath struct{}

func (FfiConverterOptionalSequenceContainerPath) Lift

func (FfiConverterOptionalSequenceContainerPath) Lower

func (FfiConverterOptionalSequenceContainerPath) LowerExternal added in v0.3.0

func (FfiConverterOptionalSequenceContainerPath) Read

func (FfiConverterOptionalSequenceContainerPath) Write

type FfiConverterOptionalSequenceTreeId

type FfiConverterOptionalSequenceTreeId struct{}

func (FfiConverterOptionalSequenceTreeId) Lift

func (FfiConverterOptionalSequenceTreeId) Lower

func (FfiConverterOptionalSequenceTreeId) LowerExternal added in v0.3.0

func (FfiConverterOptionalSequenceTreeId) Read

func (FfiConverterOptionalSequenceTreeId) Write

func (_ FfiConverterOptionalSequenceTreeId) Write(writer io.Writer, value *[]TreeId)

type FfiConverterOptionalString

type FfiConverterOptionalString struct{}

func (FfiConverterOptionalString) Lift

func (FfiConverterOptionalString) Lower

func (FfiConverterOptionalString) LowerExternal added in v0.3.0

func (c FfiConverterOptionalString) LowerExternal(value *string) ExternalCRustBuffer

func (FfiConverterOptionalString) Read

func (_ FfiConverterOptionalString) Read(reader io.Reader) *string

func (FfiConverterOptionalString) Write

func (_ FfiConverterOptionalString) Write(writer io.Writer, value *string)

type FfiConverterOptionalStyleConfig

type FfiConverterOptionalStyleConfig struct{}

func (FfiConverterOptionalStyleConfig) Lift

func (FfiConverterOptionalStyleConfig) Lower

func (FfiConverterOptionalStyleConfig) LowerExternal added in v0.3.0

func (FfiConverterOptionalStyleConfig) Read

func (FfiConverterOptionalStyleConfig) Write

func (_ FfiConverterOptionalStyleConfig) Write(writer io.Writer, value *StyleConfig)

type FfiConverterOptionalSubscription

type FfiConverterOptionalSubscription struct{}

func (FfiConverterOptionalSubscription) Lift

func (FfiConverterOptionalSubscription) Lower

func (FfiConverterOptionalSubscription) LowerExternal added in v0.3.0

func (FfiConverterOptionalSubscription) Read

func (FfiConverterOptionalSubscription) Write

func (_ FfiConverterOptionalSubscription) Write(writer io.Writer, value **Subscription)

type FfiConverterOptionalUint32

type FfiConverterOptionalUint32 struct{}

func (FfiConverterOptionalUint32) Lift

func (FfiConverterOptionalUint32) Lower

func (FfiConverterOptionalUint32) LowerExternal added in v0.3.0

func (c FfiConverterOptionalUint32) LowerExternal(value *uint32) ExternalCRustBuffer

func (FfiConverterOptionalUint32) Read

func (_ FfiConverterOptionalUint32) Read(reader io.Reader) *uint32

func (FfiConverterOptionalUint32) Write

func (_ FfiConverterOptionalUint32) Write(writer io.Writer, value *uint32)

type FfiConverterOptionalUint64

type FfiConverterOptionalUint64 struct{}

func (FfiConverterOptionalUint64) Lift

func (FfiConverterOptionalUint64) Lower

func (FfiConverterOptionalUint64) LowerExternal added in v0.3.0

func (c FfiConverterOptionalUint64) LowerExternal(value *uint64) ExternalCRustBuffer

func (FfiConverterOptionalUint64) Read

func (_ FfiConverterOptionalUint64) Read(reader io.Reader) *uint64

func (FfiConverterOptionalUint64) Write

func (_ FfiConverterOptionalUint64) Write(writer io.Writer, value *uint64)

type FfiConverterOptionalUndoItemMeta

type FfiConverterOptionalUndoItemMeta struct{}

func (FfiConverterOptionalUndoItemMeta) Lift

func (FfiConverterOptionalUndoItemMeta) Lower

func (FfiConverterOptionalUndoItemMeta) LowerExternal added in v0.3.0

func (FfiConverterOptionalUndoItemMeta) Read

func (FfiConverterOptionalUndoItemMeta) Write

func (_ FfiConverterOptionalUndoItemMeta) Write(writer io.Writer, value *UndoItemMeta)

type FfiConverterOptionalValueOrContainer

type FfiConverterOptionalValueOrContainer struct{}

func (FfiConverterOptionalValueOrContainer) Lift

func (FfiConverterOptionalValueOrContainer) Lower

func (FfiConverterOptionalValueOrContainer) LowerExternal added in v0.3.0

func (FfiConverterOptionalValueOrContainer) Read

func (FfiConverterOptionalValueOrContainer) Write

type FfiConverterOptionalVersionVector

type FfiConverterOptionalVersionVector struct{}

func (FfiConverterOptionalVersionVector) Lift

func (FfiConverterOptionalVersionVector) Lower

func (FfiConverterOptionalVersionVector) LowerExternal added in v0.3.0

func (FfiConverterOptionalVersionVector) Read

func (FfiConverterOptionalVersionVector) Write

func (_ FfiConverterOptionalVersionVector) Write(writer io.Writer, value **VersionVector)

type FfiConverterOrdering

type FfiConverterOrdering struct{}

func (FfiConverterOrdering) Lift

func (FfiConverterOrdering) Lower

func (c FfiConverterOrdering) Lower(value Ordering) C.RustBuffer

func (FfiConverterOrdering) LowerExternal added in v0.3.0

func (c FfiConverterOrdering) LowerExternal(value Ordering) ExternalCRustBuffer

func (FfiConverterOrdering) Read

func (FfiConverterOrdering) Read(reader io.Reader) Ordering

func (FfiConverterOrdering) Write

func (FfiConverterOrdering) Write(writer io.Writer, value Ordering)

type FfiConverterPathItem

type FfiConverterPathItem struct{}

func (FfiConverterPathItem) Lift

func (FfiConverterPathItem) Lower

func (c FfiConverterPathItem) Lower(value PathItem) C.RustBuffer

func (FfiConverterPathItem) LowerExternal added in v0.3.0

func (c FfiConverterPathItem) LowerExternal(value PathItem) ExternalCRustBuffer

func (FfiConverterPathItem) Read

func (c FfiConverterPathItem) Read(reader io.Reader) PathItem

func (FfiConverterPathItem) Write

func (c FfiConverterPathItem) Write(writer io.Writer, value PathItem)

type FfiConverterPeerInfo

type FfiConverterPeerInfo struct{}

func (FfiConverterPeerInfo) Lift

func (FfiConverterPeerInfo) Lower

func (c FfiConverterPeerInfo) Lower(value PeerInfo) C.RustBuffer

func (FfiConverterPeerInfo) LowerExternal added in v0.3.0

func (c FfiConverterPeerInfo) LowerExternal(value PeerInfo) ExternalCRustBuffer

func (FfiConverterPeerInfo) Read

func (c FfiConverterPeerInfo) Read(reader io.Reader) PeerInfo

func (FfiConverterPeerInfo) Write

func (c FfiConverterPeerInfo) Write(writer io.Writer, value PeerInfo)

type FfiConverterPosQueryResult

type FfiConverterPosQueryResult struct{}

func (FfiConverterPosQueryResult) Lift

func (FfiConverterPosQueryResult) Lower

func (FfiConverterPosQueryResult) LowerExternal added in v0.3.0

func (FfiConverterPosQueryResult) Read

func (FfiConverterPosQueryResult) Write

func (c FfiConverterPosQueryResult) Write(writer io.Writer, value PosQueryResult)

type FfiConverterPosType added in v0.2.0

type FfiConverterPosType struct{}

func (FfiConverterPosType) Lift added in v0.2.0

func (FfiConverterPosType) Lower added in v0.2.0

func (c FfiConverterPosType) Lower(value PosType) C.RustBuffer

func (FfiConverterPosType) LowerExternal added in v0.3.0

func (c FfiConverterPosType) LowerExternal(value PosType) ExternalCRustBuffer

func (FfiConverterPosType) Read added in v0.2.0

func (FfiConverterPosType) Read(reader io.Reader) PosType

func (FfiConverterPosType) Write added in v0.2.0

func (FfiConverterPosType) Write(writer io.Writer, value PosType)

type FfiConverterPreCommitCallback

type FfiConverterPreCommitCallback struct {
	// contains filtered or unexported fields
}

func (FfiConverterPreCommitCallback) Lift

func (FfiConverterPreCommitCallback) Lower

func (FfiConverterPreCommitCallback) Read

func (FfiConverterPreCommitCallback) Write

type FfiConverterPreCommitCallbackPayload

type FfiConverterPreCommitCallbackPayload struct{}

func (FfiConverterPreCommitCallbackPayload) Lift

func (FfiConverterPreCommitCallbackPayload) Lower

func (FfiConverterPreCommitCallbackPayload) LowerExternal added in v0.3.0

func (FfiConverterPreCommitCallbackPayload) Read

func (FfiConverterPreCommitCallbackPayload) Write

type FfiConverterSequenceBytes

type FfiConverterSequenceBytes struct{}

func (FfiConverterSequenceBytes) Lift

func (FfiConverterSequenceBytes) Lower

func (c FfiConverterSequenceBytes) Lower(value [][]byte) C.RustBuffer

func (FfiConverterSequenceBytes) LowerExternal added in v0.3.0

func (c FfiConverterSequenceBytes) LowerExternal(value [][]byte) ExternalCRustBuffer

func (FfiConverterSequenceBytes) Read

func (c FfiConverterSequenceBytes) Read(reader io.Reader) [][]byte

func (FfiConverterSequenceBytes) Write

func (c FfiConverterSequenceBytes) Write(writer io.Writer, value [][]byte)

type FfiConverterSequenceContainerDiff

type FfiConverterSequenceContainerDiff struct{}

func (FfiConverterSequenceContainerDiff) Lift

func (FfiConverterSequenceContainerDiff) Lower

func (FfiConverterSequenceContainerDiff) LowerExternal added in v0.3.0

func (FfiConverterSequenceContainerDiff) Read

func (FfiConverterSequenceContainerDiff) Write

func (c FfiConverterSequenceContainerDiff) Write(writer io.Writer, value []ContainerDiff)

type FfiConverterSequenceContainerId

type FfiConverterSequenceContainerId struct{}

func (FfiConverterSequenceContainerId) Lift

func (FfiConverterSequenceContainerId) Lower

func (FfiConverterSequenceContainerId) LowerExternal added in v0.3.0

func (FfiConverterSequenceContainerId) Read

func (FfiConverterSequenceContainerId) Write

func (c FfiConverterSequenceContainerId) Write(writer io.Writer, value []ContainerId)

type FfiConverterSequenceContainerIdAndDiff

type FfiConverterSequenceContainerIdAndDiff struct{}

func (FfiConverterSequenceContainerIdAndDiff) Lift

func (FfiConverterSequenceContainerIdAndDiff) Lower

func (FfiConverterSequenceContainerIdAndDiff) LowerExternal added in v0.3.0

func (FfiConverterSequenceContainerIdAndDiff) Read

func (FfiConverterSequenceContainerIdAndDiff) Write

type FfiConverterSequenceContainerPath

type FfiConverterSequenceContainerPath struct{}

func (FfiConverterSequenceContainerPath) Lift

func (FfiConverterSequenceContainerPath) Lower

func (FfiConverterSequenceContainerPath) LowerExternal added in v0.3.0

func (FfiConverterSequenceContainerPath) Read

func (FfiConverterSequenceContainerPath) Write

func (c FfiConverterSequenceContainerPath) Write(writer io.Writer, value []ContainerPath)

type FfiConverterSequenceCursorWithPos

type FfiConverterSequenceCursorWithPos struct{}

func (FfiConverterSequenceCursorWithPos) Lift

func (FfiConverterSequenceCursorWithPos) Lower

func (FfiConverterSequenceCursorWithPos) LowerExternal added in v0.3.0

func (FfiConverterSequenceCursorWithPos) Read

func (FfiConverterSequenceCursorWithPos) Write

func (c FfiConverterSequenceCursorWithPos) Write(writer io.Writer, value []CursorWithPos)

type FfiConverterSequenceId

type FfiConverterSequenceId struct{}

func (FfiConverterSequenceId) Lift

func (c FfiConverterSequenceId) Lift(rb RustBufferI) []Id

func (FfiConverterSequenceId) Lower

func (c FfiConverterSequenceId) Lower(value []Id) C.RustBuffer

func (FfiConverterSequenceId) LowerExternal added in v0.3.0

func (c FfiConverterSequenceId) LowerExternal(value []Id) ExternalCRustBuffer

func (FfiConverterSequenceId) Read

func (c FfiConverterSequenceId) Read(reader io.Reader) []Id

func (FfiConverterSequenceId) Write

func (c FfiConverterSequenceId) Write(writer io.Writer, value []Id)

type FfiConverterSequenceIdSpan

type FfiConverterSequenceIdSpan struct{}

func (FfiConverterSequenceIdSpan) Lift

func (FfiConverterSequenceIdSpan) Lower

func (c FfiConverterSequenceIdSpan) Lower(value []IdSpan) C.RustBuffer

func (FfiConverterSequenceIdSpan) LowerExternal added in v0.3.0

func (c FfiConverterSequenceIdSpan) LowerExternal(value []IdSpan) ExternalCRustBuffer

func (FfiConverterSequenceIdSpan) Read

func (c FfiConverterSequenceIdSpan) Read(reader io.Reader) []IdSpan

func (FfiConverterSequenceIdSpan) Write

func (c FfiConverterSequenceIdSpan) Write(writer io.Writer, value []IdSpan)

type FfiConverterSequenceIndex

type FfiConverterSequenceIndex struct{}

func (FfiConverterSequenceIndex) Lift

func (FfiConverterSequenceIndex) Lower

func (c FfiConverterSequenceIndex) Lower(value []Index) C.RustBuffer

func (FfiConverterSequenceIndex) LowerExternal added in v0.3.0

func (c FfiConverterSequenceIndex) LowerExternal(value []Index) ExternalCRustBuffer

func (FfiConverterSequenceIndex) Read

func (c FfiConverterSequenceIndex) Read(reader io.Reader) []Index

func (FfiConverterSequenceIndex) Write

func (c FfiConverterSequenceIndex) Write(writer io.Writer, value []Index)

type FfiConverterSequenceListDiffItem

type FfiConverterSequenceListDiffItem struct{}

func (FfiConverterSequenceListDiffItem) Lift

func (FfiConverterSequenceListDiffItem) Lower

func (FfiConverterSequenceListDiffItem) LowerExternal added in v0.3.0

func (FfiConverterSequenceListDiffItem) Read

func (FfiConverterSequenceListDiffItem) Write

func (c FfiConverterSequenceListDiffItem) Write(writer io.Writer, value []ListDiffItem)

type FfiConverterSequenceLoroValue

type FfiConverterSequenceLoroValue struct{}

func (FfiConverterSequenceLoroValue) Lift

func (FfiConverterSequenceLoroValue) Lower

func (FfiConverterSequenceLoroValue) LowerExternal added in v0.3.0

func (FfiConverterSequenceLoroValue) Read

func (FfiConverterSequenceLoroValue) Write

func (c FfiConverterSequenceLoroValue) Write(writer io.Writer, value []LoroValue)

type FfiConverterSequencePathItem

type FfiConverterSequencePathItem struct{}

func (FfiConverterSequencePathItem) Lift

func (FfiConverterSequencePathItem) Lower

func (FfiConverterSequencePathItem) LowerExternal added in v0.3.0

func (FfiConverterSequencePathItem) Read

func (FfiConverterSequencePathItem) Write

func (c FfiConverterSequencePathItem) Write(writer io.Writer, value []PathItem)

type FfiConverterSequenceString

type FfiConverterSequenceString struct{}

func (FfiConverterSequenceString) Lift

func (FfiConverterSequenceString) Lower

func (c FfiConverterSequenceString) Lower(value []string) C.RustBuffer

func (FfiConverterSequenceString) LowerExternal added in v0.3.0

func (c FfiConverterSequenceString) LowerExternal(value []string) ExternalCRustBuffer

func (FfiConverterSequenceString) Read

func (c FfiConverterSequenceString) Read(reader io.Reader) []string

func (FfiConverterSequenceString) Write

func (c FfiConverterSequenceString) Write(writer io.Writer, value []string)

type FfiConverterSequenceTextDelta

type FfiConverterSequenceTextDelta struct{}

func (FfiConverterSequenceTextDelta) Lift

func (FfiConverterSequenceTextDelta) Lower

func (FfiConverterSequenceTextDelta) LowerExternal added in v0.3.0

func (FfiConverterSequenceTextDelta) Read

func (FfiConverterSequenceTextDelta) Write

func (c FfiConverterSequenceTextDelta) Write(writer io.Writer, value []TextDelta)

type FfiConverterSequenceTreeDiffItem

type FfiConverterSequenceTreeDiffItem struct{}

func (FfiConverterSequenceTreeDiffItem) Lift

func (FfiConverterSequenceTreeDiffItem) Lower

func (FfiConverterSequenceTreeDiffItem) LowerExternal added in v0.3.0

func (FfiConverterSequenceTreeDiffItem) Read

func (FfiConverterSequenceTreeDiffItem) Write

func (c FfiConverterSequenceTreeDiffItem) Write(writer io.Writer, value []TreeDiffItem)

type FfiConverterSequenceTreeId

type FfiConverterSequenceTreeId struct{}

func (FfiConverterSequenceTreeId) Lift

func (FfiConverterSequenceTreeId) Lower

func (c FfiConverterSequenceTreeId) Lower(value []TreeId) C.RustBuffer

func (FfiConverterSequenceTreeId) LowerExternal added in v0.3.0

func (c FfiConverterSequenceTreeId) LowerExternal(value []TreeId) ExternalCRustBuffer

func (FfiConverterSequenceTreeId) Read

func (c FfiConverterSequenceTreeId) Read(reader io.Reader) []TreeId

func (FfiConverterSequenceTreeId) Write

func (c FfiConverterSequenceTreeId) Write(writer io.Writer, value []TreeId)

type FfiConverterSequenceUint64

type FfiConverterSequenceUint64 struct{}

func (FfiConverterSequenceUint64) Lift

func (FfiConverterSequenceUint64) Lower

func (c FfiConverterSequenceUint64) Lower(value []uint64) C.RustBuffer

func (FfiConverterSequenceUint64) LowerExternal added in v0.3.0

func (c FfiConverterSequenceUint64) LowerExternal(value []uint64) ExternalCRustBuffer

func (FfiConverterSequenceUint64) Read

func (c FfiConverterSequenceUint64) Read(reader io.Reader) []uint64

func (FfiConverterSequenceUint64) Write

func (c FfiConverterSequenceUint64) Write(writer io.Writer, value []uint64)

type FfiConverterSequenceValueOrContainer

type FfiConverterSequenceValueOrContainer struct{}

func (FfiConverterSequenceValueOrContainer) Lift

func (FfiConverterSequenceValueOrContainer) Lower

func (FfiConverterSequenceValueOrContainer) LowerExternal added in v0.3.0

func (FfiConverterSequenceValueOrContainer) Read

func (FfiConverterSequenceValueOrContainer) Write

type FfiConverterSequenceVersionRangeItem

type FfiConverterSequenceVersionRangeItem struct{}

func (FfiConverterSequenceVersionRangeItem) Lift

func (FfiConverterSequenceVersionRangeItem) Lower

func (FfiConverterSequenceVersionRangeItem) LowerExternal added in v0.3.0

func (FfiConverterSequenceVersionRangeItem) Read

func (FfiConverterSequenceVersionRangeItem) Write

type FfiConverterSide

type FfiConverterSide struct{}

func (FfiConverterSide) Lift

func (c FfiConverterSide) Lift(rb RustBufferI) Side

func (FfiConverterSide) Lower

func (c FfiConverterSide) Lower(value Side) C.RustBuffer

func (FfiConverterSide) LowerExternal added in v0.3.0

func (c FfiConverterSide) LowerExternal(value Side) ExternalCRustBuffer

func (FfiConverterSide) Read

func (FfiConverterSide) Read(reader io.Reader) Side

func (FfiConverterSide) Write

func (FfiConverterSide) Write(writer io.Writer, value Side)

type FfiConverterString

type FfiConverterString struct{}

func (FfiConverterString) Lift

func (FfiConverterString) Lower

func (FfiConverterString) Lower(value string) C.RustBuffer

func (FfiConverterString) LowerExternal added in v0.3.0

func (c FfiConverterString) LowerExternal(value string) ExternalCRustBuffer

func (FfiConverterString) Read

func (FfiConverterString) Read(reader io.Reader) string

func (FfiConverterString) Write

func (FfiConverterString) Write(writer io.Writer, value string)

type FfiConverterStyleConfig

type FfiConverterStyleConfig struct{}

func (FfiConverterStyleConfig) Lift

func (FfiConverterStyleConfig) Lower

func (FfiConverterStyleConfig) LowerExternal added in v0.3.0

func (FfiConverterStyleConfig) Read

func (FfiConverterStyleConfig) Write

func (c FfiConverterStyleConfig) Write(writer io.Writer, value StyleConfig)

type FfiConverterStyleConfigMap

type FfiConverterStyleConfigMap struct{}

func (FfiConverterStyleConfigMap) Lift

func (FfiConverterStyleConfigMap) Lower

func (FfiConverterStyleConfigMap) Read

func (FfiConverterStyleConfigMap) Write

func (c FfiConverterStyleConfigMap) Write(writer io.Writer, value *StyleConfigMap)

type FfiConverterSubscriber

type FfiConverterSubscriber struct {
	// contains filtered or unexported fields
}

func (FfiConverterSubscriber) Lift

func (FfiConverterSubscriber) Lower

func (FfiConverterSubscriber) Read

func (c FfiConverterSubscriber) Read(reader io.Reader) Subscriber

func (FfiConverterSubscriber) Write

func (c FfiConverterSubscriber) Write(writer io.Writer, value Subscriber)

type FfiConverterSubscription

type FfiConverterSubscription struct{}

func (FfiConverterSubscription) Lift

func (FfiConverterSubscription) Lower

func (FfiConverterSubscription) Read

func (FfiConverterSubscription) Write

func (c FfiConverterSubscription) Write(writer io.Writer, value *Subscription)

type FfiConverterTextDelta

type FfiConverterTextDelta struct{}

func (FfiConverterTextDelta) Lift

func (FfiConverterTextDelta) Lower

func (FfiConverterTextDelta) LowerExternal added in v0.3.0

func (c FfiConverterTextDelta) LowerExternal(value TextDelta) ExternalCRustBuffer

func (FfiConverterTextDelta) Read

func (FfiConverterTextDelta) Write

func (FfiConverterTextDelta) Write(writer io.Writer, value TextDelta)

type FfiConverterTreeDiff

type FfiConverterTreeDiff struct{}

func (FfiConverterTreeDiff) Lift

func (FfiConverterTreeDiff) Lower

func (c FfiConverterTreeDiff) Lower(value TreeDiff) C.RustBuffer

func (FfiConverterTreeDiff) LowerExternal added in v0.3.0

func (c FfiConverterTreeDiff) LowerExternal(value TreeDiff) ExternalCRustBuffer

func (FfiConverterTreeDiff) Read

func (c FfiConverterTreeDiff) Read(reader io.Reader) TreeDiff

func (FfiConverterTreeDiff) Write

func (c FfiConverterTreeDiff) Write(writer io.Writer, value TreeDiff)

type FfiConverterTreeDiffItem

type FfiConverterTreeDiffItem struct{}

func (FfiConverterTreeDiffItem) Lift

func (FfiConverterTreeDiffItem) Lower

func (FfiConverterTreeDiffItem) LowerExternal added in v0.3.0

func (FfiConverterTreeDiffItem) Read

func (FfiConverterTreeDiffItem) Write

func (c FfiConverterTreeDiffItem) Write(writer io.Writer, value TreeDiffItem)

type FfiConverterTreeExternalDiff

type FfiConverterTreeExternalDiff struct{}

func (FfiConverterTreeExternalDiff) Lift

func (FfiConverterTreeExternalDiff) Lower

func (FfiConverterTreeExternalDiff) LowerExternal added in v0.3.0

func (FfiConverterTreeExternalDiff) Read

func (FfiConverterTreeExternalDiff) Write

type FfiConverterTreeId

type FfiConverterTreeId struct{}

func (FfiConverterTreeId) Lift

func (FfiConverterTreeId) Lower

func (c FfiConverterTreeId) Lower(value TreeId) C.RustBuffer

func (FfiConverterTreeId) LowerExternal added in v0.3.0

func (c FfiConverterTreeId) LowerExternal(value TreeId) ExternalCRustBuffer

func (FfiConverterTreeId) Read

func (c FfiConverterTreeId) Read(reader io.Reader) TreeId

func (FfiConverterTreeId) Write

func (c FfiConverterTreeId) Write(writer io.Writer, value TreeId)

type FfiConverterTreeParentId

type FfiConverterTreeParentId struct{}

func (FfiConverterTreeParentId) Lift

func (FfiConverterTreeParentId) Lower

func (FfiConverterTreeParentId) LowerExternal added in v0.3.0

func (FfiConverterTreeParentId) Read

func (FfiConverterTreeParentId) Write

func (FfiConverterTreeParentId) Write(writer io.Writer, value TreeParentId)

type FfiConverterUint8

type FfiConverterUint8 struct{}

func (FfiConverterUint8) Lift

func (FfiConverterUint8) Lift(value C.uint8_t) uint8

func (FfiConverterUint8) Lower

func (FfiConverterUint8) Lower(value uint8) C.uint8_t

func (FfiConverterUint8) Read

func (FfiConverterUint8) Read(reader io.Reader) uint8

func (FfiConverterUint8) Write

func (FfiConverterUint8) Write(writer io.Writer, value uint8)

type FfiConverterUint32

type FfiConverterUint32 struct{}

func (FfiConverterUint32) Lift

func (FfiConverterUint32) Lift(value C.uint32_t) uint32

func (FfiConverterUint32) Lower

func (FfiConverterUint32) Lower(value uint32) C.uint32_t

func (FfiConverterUint32) Read

func (FfiConverterUint32) Read(reader io.Reader) uint32

func (FfiConverterUint32) Write

func (FfiConverterUint32) Write(writer io.Writer, value uint32)

type FfiConverterUint64

type FfiConverterUint64 struct{}

func (FfiConverterUint64) Lift

func (FfiConverterUint64) Lift(value C.uint64_t) uint64

func (FfiConverterUint64) Lower

func (FfiConverterUint64) Lower(value uint64) C.uint64_t

func (FfiConverterUint64) Read

func (FfiConverterUint64) Read(reader io.Reader) uint64

func (FfiConverterUint64) Write

func (FfiConverterUint64) Write(writer io.Writer, value uint64)

type FfiConverterUndoItemMeta

type FfiConverterUndoItemMeta struct{}

func (FfiConverterUndoItemMeta) Lift

func (FfiConverterUndoItemMeta) Lower

func (FfiConverterUndoItemMeta) LowerExternal added in v0.3.0

func (FfiConverterUndoItemMeta) Read

func (FfiConverterUndoItemMeta) Write

func (c FfiConverterUndoItemMeta) Write(writer io.Writer, value UndoItemMeta)

type FfiConverterUndoManager

type FfiConverterUndoManager struct{}

func (FfiConverterUndoManager) Lift

func (FfiConverterUndoManager) Lower

func (FfiConverterUndoManager) Read

func (c FfiConverterUndoManager) Read(reader io.Reader) *UndoManager

func (FfiConverterUndoManager) Write

func (c FfiConverterUndoManager) Write(writer io.Writer, value *UndoManager)

type FfiConverterUndoOrRedo

type FfiConverterUndoOrRedo struct{}

func (FfiConverterUndoOrRedo) Lift

func (FfiConverterUndoOrRedo) Lower

func (FfiConverterUndoOrRedo) LowerExternal added in v0.3.0

func (c FfiConverterUndoOrRedo) LowerExternal(value UndoOrRedo) ExternalCRustBuffer

func (FfiConverterUndoOrRedo) Read

func (FfiConverterUndoOrRedo) Write

func (FfiConverterUndoOrRedo) Write(writer io.Writer, value UndoOrRedo)

type FfiConverterUnsubscriber

type FfiConverterUnsubscriber struct {
	// contains filtered or unexported fields
}

func (FfiConverterUnsubscriber) Lift

func (FfiConverterUnsubscriber) Lower

func (FfiConverterUnsubscriber) Read

func (FfiConverterUnsubscriber) Write

func (c FfiConverterUnsubscriber) Write(writer io.Writer, value Unsubscriber)

type FfiConverterUpdateOptions

type FfiConverterUpdateOptions struct{}

func (FfiConverterUpdateOptions) Lift

func (FfiConverterUpdateOptions) Lower

func (FfiConverterUpdateOptions) LowerExternal added in v0.3.0

func (FfiConverterUpdateOptions) Read

func (FfiConverterUpdateOptions) Write

func (c FfiConverterUpdateOptions) Write(writer io.Writer, value UpdateOptions)

type FfiConverterUpdateTimeoutError

type FfiConverterUpdateTimeoutError struct{}

func (FfiConverterUpdateTimeoutError) Lift

func (FfiConverterUpdateTimeoutError) Lower

func (FfiConverterUpdateTimeoutError) LowerExternal added in v0.3.0

func (FfiConverterUpdateTimeoutError) Read

func (FfiConverterUpdateTimeoutError) Write

type FfiConverterValueOrContainer

type FfiConverterValueOrContainer struct{}

func (FfiConverterValueOrContainer) Lift

func (FfiConverterValueOrContainer) Lower

func (FfiConverterValueOrContainer) Read

func (FfiConverterValueOrContainer) Write

func (c FfiConverterValueOrContainer) Write(writer io.Writer, value *ValueOrContainer)

type FfiConverterVersionRange

type FfiConverterVersionRange struct{}

func (FfiConverterVersionRange) Lift

func (FfiConverterVersionRange) Lower

func (FfiConverterVersionRange) Read

func (FfiConverterVersionRange) Write

func (c FfiConverterVersionRange) Write(writer io.Writer, value *VersionRange)

type FfiConverterVersionRangeItem

type FfiConverterVersionRangeItem struct{}

func (FfiConverterVersionRangeItem) Lift

func (FfiConverterVersionRangeItem) Lower

func (FfiConverterVersionRangeItem) LowerExternal added in v0.3.0

func (FfiConverterVersionRangeItem) Read

func (FfiConverterVersionRangeItem) Write

func (c FfiConverterVersionRangeItem) Write(writer io.Writer, value VersionRangeItem)

type FfiConverterVersionVector

type FfiConverterVersionVector struct{}

func (FfiConverterVersionVector) Lift

func (FfiConverterVersionVector) Lower

func (FfiConverterVersionVector) Read

func (FfiConverterVersionVector) Write

func (c FfiConverterVersionVector) Write(writer io.Writer, value *VersionVector)

type FfiConverterVersionVectorDiff

type FfiConverterVersionVectorDiff struct{}

func (FfiConverterVersionVectorDiff) Lift

func (FfiConverterVersionVectorDiff) Lower

func (FfiConverterVersionVectorDiff) LowerExternal added in v0.3.0

func (FfiConverterVersionVectorDiff) Read

func (FfiConverterVersionVectorDiff) Write

type FfiDestroyerAbsolutePosition

type FfiDestroyerAbsolutePosition struct{}

func (FfiDestroyerAbsolutePosition) Destroy

type FfiDestroyerAwareness

type FfiDestroyerAwareness struct{}

func (FfiDestroyerAwareness) Destroy

func (_ FfiDestroyerAwareness) Destroy(value *Awareness)

type FfiDestroyerAwarenessPeerUpdate

type FfiDestroyerAwarenessPeerUpdate struct{}

func (FfiDestroyerAwarenessPeerUpdate) Destroy

type FfiDestroyerBool

type FfiDestroyerBool struct{}

func (FfiDestroyerBool) Destroy

func (FfiDestroyerBool) Destroy(_ bool)

type FfiDestroyerBytes

type FfiDestroyerBytes struct{}

func (FfiDestroyerBytes) Destroy

func (FfiDestroyerBytes) Destroy(_ []byte)

type FfiDestroyerCannotFindRelativePosition

type FfiDestroyerCannotFindRelativePosition struct{}

func (FfiDestroyerCannotFindRelativePosition) Destroy

type FfiDestroyerChangeAncestorsTraveler

type FfiDestroyerChangeAncestorsTraveler struct{}

func (FfiDestroyerChangeAncestorsTraveler) Destroy

type FfiDestroyerChangeMeta

type FfiDestroyerChangeMeta struct{}

func (FfiDestroyerChangeMeta) Destroy

func (_ FfiDestroyerChangeMeta) Destroy(value ChangeMeta)

type FfiDestroyerChangeModifier

type FfiDestroyerChangeModifier struct{}

func (FfiDestroyerChangeModifier) Destroy

func (_ FfiDestroyerChangeModifier) Destroy(value *ChangeModifier)

type FfiDestroyerChangeTravelError

type FfiDestroyerChangeTravelError struct{}

func (FfiDestroyerChangeTravelError) Destroy

type FfiDestroyerCommitOptions

type FfiDestroyerCommitOptions struct{}

func (FfiDestroyerCommitOptions) Destroy

func (_ FfiDestroyerCommitOptions) Destroy(value CommitOptions)

type FfiDestroyerConfigure

type FfiDestroyerConfigure struct{}

func (FfiDestroyerConfigure) Destroy

func (_ FfiDestroyerConfigure) Destroy(value *Configure)

type FfiDestroyerContainerDiff

type FfiDestroyerContainerDiff struct{}

func (FfiDestroyerContainerDiff) Destroy

func (_ FfiDestroyerContainerDiff) Destroy(value ContainerDiff)

type FfiDestroyerContainerId

type FfiDestroyerContainerId struct{}

func (FfiDestroyerContainerId) Destroy

func (_ FfiDestroyerContainerId) Destroy(value ContainerId)

type FfiDestroyerContainerIdAndDiff

type FfiDestroyerContainerIdAndDiff struct{}

func (FfiDestroyerContainerIdAndDiff) Destroy

type FfiDestroyerContainerIdLike

type FfiDestroyerContainerIdLike struct{}

func (FfiDestroyerContainerIdLike) Destroy

type FfiDestroyerContainerPath

type FfiDestroyerContainerPath struct{}

func (FfiDestroyerContainerPath) Destroy

func (_ FfiDestroyerContainerPath) Destroy(value ContainerPath)

type FfiDestroyerContainerType

type FfiDestroyerContainerType struct{}

func (FfiDestroyerContainerType) Destroy

func (_ FfiDestroyerContainerType) Destroy(value ContainerType)

type FfiDestroyerCounterSpan

type FfiDestroyerCounterSpan struct{}

func (FfiDestroyerCounterSpan) Destroy

func (_ FfiDestroyerCounterSpan) Destroy(value CounterSpan)

type FfiDestroyerCursor

type FfiDestroyerCursor struct{}

func (FfiDestroyerCursor) Destroy

func (_ FfiDestroyerCursor) Destroy(value *Cursor)

type FfiDestroyerCursorWithPos

type FfiDestroyerCursorWithPos struct{}

func (FfiDestroyerCursorWithPos) Destroy

func (_ FfiDestroyerCursorWithPos) Destroy(value CursorWithPos)

type FfiDestroyerDiff

type FfiDestroyerDiff struct{}

func (FfiDestroyerDiff) Destroy

func (_ FfiDestroyerDiff) Destroy(value Diff)

type FfiDestroyerDiffBatch

type FfiDestroyerDiffBatch struct{}

func (FfiDestroyerDiffBatch) Destroy

func (_ FfiDestroyerDiffBatch) Destroy(value *DiffBatch)

type FfiDestroyerDiffEvent

type FfiDestroyerDiffEvent struct{}

func (FfiDestroyerDiffEvent) Destroy

func (_ FfiDestroyerDiffEvent) Destroy(value DiffEvent)

type FfiDestroyerEphemeralEventTrigger

type FfiDestroyerEphemeralEventTrigger struct{}

func (FfiDestroyerEphemeralEventTrigger) Destroy

type FfiDestroyerEphemeralStore

type FfiDestroyerEphemeralStore struct{}

func (FfiDestroyerEphemeralStore) Destroy

func (_ FfiDestroyerEphemeralStore) Destroy(value *EphemeralStore)

type FfiDestroyerEphemeralStoreEvent

type FfiDestroyerEphemeralStoreEvent struct{}

func (FfiDestroyerEphemeralStoreEvent) Destroy

type FfiDestroyerEphemeralSubscriber

type FfiDestroyerEphemeralSubscriber struct{}

func (FfiDestroyerEphemeralSubscriber) Destroy

type FfiDestroyerEventTriggerKind

type FfiDestroyerEventTriggerKind struct{}

func (FfiDestroyerEventTriggerKind) Destroy

type FfiDestroyerExpandType

type FfiDestroyerExpandType struct{}

func (FfiDestroyerExpandType) Destroy

func (_ FfiDestroyerExpandType) Destroy(value ExpandType)

type FfiDestroyerExportMode added in v0.3.0

type FfiDestroyerExportMode struct{}

func (FfiDestroyerExportMode) Destroy added in v0.3.0

func (_ FfiDestroyerExportMode) Destroy(value ExportMode)

type FfiDestroyerFirstCommitFromPeerCallback

type FfiDestroyerFirstCommitFromPeerCallback struct{}

func (FfiDestroyerFirstCommitFromPeerCallback) Destroy

type FfiDestroyerFirstCommitFromPeerPayload

type FfiDestroyerFirstCommitFromPeerPayload struct{}

func (FfiDestroyerFirstCommitFromPeerPayload) Destroy

type FfiDestroyerFloat64

type FfiDestroyerFloat64 struct{}

func (FfiDestroyerFloat64) Destroy

func (FfiDestroyerFloat64) Destroy(_ float64)

type FfiDestroyerFractionalIndex

type FfiDestroyerFractionalIndex struct{}

func (FfiDestroyerFractionalIndex) Destroy

func (_ FfiDestroyerFractionalIndex) Destroy(value *FractionalIndex)

type FfiDestroyerFrontiers

type FfiDestroyerFrontiers struct{}

func (FfiDestroyerFrontiers) Destroy

func (_ FfiDestroyerFrontiers) Destroy(value *Frontiers)

type FfiDestroyerFrontiersOrId

type FfiDestroyerFrontiersOrId struct{}

func (FfiDestroyerFrontiersOrId) Destroy

func (_ FfiDestroyerFrontiersOrId) Destroy(value FrontiersOrId)

type FfiDestroyerId

type FfiDestroyerId struct{}

func (FfiDestroyerId) Destroy

func (_ FfiDestroyerId) Destroy(value Id)

type FfiDestroyerIdLp

type FfiDestroyerIdLp struct{}

func (FfiDestroyerIdLp) Destroy

func (_ FfiDestroyerIdLp) Destroy(value IdLp)

type FfiDestroyerIdSpan

type FfiDestroyerIdSpan struct{}

func (FfiDestroyerIdSpan) Destroy

func (_ FfiDestroyerIdSpan) Destroy(value IdSpan)

type FfiDestroyerImportBlobMetadata

type FfiDestroyerImportBlobMetadata struct{}

func (FfiDestroyerImportBlobMetadata) Destroy

type FfiDestroyerImportStatus

type FfiDestroyerImportStatus struct{}

func (FfiDestroyerImportStatus) Destroy

func (_ FfiDestroyerImportStatus) Destroy(value ImportStatus)

type FfiDestroyerIndex

type FfiDestroyerIndex struct{}

func (FfiDestroyerIndex) Destroy

func (_ FfiDestroyerIndex) Destroy(value Index)

type FfiDestroyerInt32

type FfiDestroyerInt32 struct{}

func (FfiDestroyerInt32) Destroy

func (FfiDestroyerInt32) Destroy(_ int32)

type FfiDestroyerInt64

type FfiDestroyerInt64 struct{}

func (FfiDestroyerInt64) Destroy

func (FfiDestroyerInt64) Destroy(_ int64)

type FfiDestroyerJsonPathError

type FfiDestroyerJsonPathError struct{}

func (FfiDestroyerJsonPathError) Destroy

func (_ FfiDestroyerJsonPathError) Destroy(value *JsonPathError)

type FfiDestroyerJsonPathSubscriber added in v0.2.0

type FfiDestroyerJsonPathSubscriber struct{}

func (FfiDestroyerJsonPathSubscriber) Destroy added in v0.2.0

type FfiDestroyerListDiffItem

type FfiDestroyerListDiffItem struct{}

func (FfiDestroyerListDiffItem) Destroy

func (_ FfiDestroyerListDiffItem) Destroy(value ListDiffItem)

type FfiDestroyerLocalEphemeralListener

type FfiDestroyerLocalEphemeralListener struct{}

func (FfiDestroyerLocalEphemeralListener) Destroy

type FfiDestroyerLocalUpdateCallback

type FfiDestroyerLocalUpdateCallback struct{}

func (FfiDestroyerLocalUpdateCallback) Destroy

type FfiDestroyerLoroCounter

type FfiDestroyerLoroCounter struct{}

func (FfiDestroyerLoroCounter) Destroy

func (_ FfiDestroyerLoroCounter) Destroy(value *LoroCounter)

type FfiDestroyerLoroDoc

type FfiDestroyerLoroDoc struct{}

func (FfiDestroyerLoroDoc) Destroy

func (_ FfiDestroyerLoroDoc) Destroy(value *LoroDoc)

type FfiDestroyerLoroEncodeError

type FfiDestroyerLoroEncodeError struct{}

func (FfiDestroyerLoroEncodeError) Destroy

func (_ FfiDestroyerLoroEncodeError) Destroy(value *LoroEncodeError)

type FfiDestroyerLoroError

type FfiDestroyerLoroError struct{}

func (FfiDestroyerLoroError) Destroy

func (_ FfiDestroyerLoroError) Destroy(value *LoroError)

type FfiDestroyerLoroList

type FfiDestroyerLoroList struct{}

func (FfiDestroyerLoroList) Destroy

func (_ FfiDestroyerLoroList) Destroy(value *LoroList)

type FfiDestroyerLoroMap

type FfiDestroyerLoroMap struct{}

func (FfiDestroyerLoroMap) Destroy

func (_ FfiDestroyerLoroMap) Destroy(value *LoroMap)

type FfiDestroyerLoroMovableList

type FfiDestroyerLoroMovableList struct{}

func (FfiDestroyerLoroMovableList) Destroy

func (_ FfiDestroyerLoroMovableList) Destroy(value *LoroMovableList)

type FfiDestroyerLoroText

type FfiDestroyerLoroText struct{}

func (FfiDestroyerLoroText) Destroy

func (_ FfiDestroyerLoroText) Destroy(value *LoroText)

type FfiDestroyerLoroTree

type FfiDestroyerLoroTree struct{}

func (FfiDestroyerLoroTree) Destroy

func (_ FfiDestroyerLoroTree) Destroy(value *LoroTree)

type FfiDestroyerLoroUnknown

type FfiDestroyerLoroUnknown struct{}

func (FfiDestroyerLoroUnknown) Destroy

func (_ FfiDestroyerLoroUnknown) Destroy(value *LoroUnknown)

type FfiDestroyerLoroValue

type FfiDestroyerLoroValue struct{}

func (FfiDestroyerLoroValue) Destroy

func (_ FfiDestroyerLoroValue) Destroy(value LoroValue)

type FfiDestroyerLoroValueLike

type FfiDestroyerLoroValueLike struct{}

func (FfiDestroyerLoroValueLike) Destroy

func (_ FfiDestroyerLoroValueLike) Destroy(value LoroValueLike)

type FfiDestroyerMapDelta

type FfiDestroyerMapDelta struct{}

func (FfiDestroyerMapDelta) Destroy

func (_ FfiDestroyerMapDelta) Destroy(value MapDelta)

type FfiDestroyerMapStringLoroValue

type FfiDestroyerMapStringLoroValue struct{}

func (FfiDestroyerMapStringLoroValue) Destroy

func (_ FfiDestroyerMapStringLoroValue) Destroy(mapValue map[string]LoroValue)

type FfiDestroyerMapStringOptionalValueOrContainer

type FfiDestroyerMapStringOptionalValueOrContainer struct{}

func (FfiDestroyerMapStringOptionalValueOrContainer) Destroy

type FfiDestroyerMapUint64CounterSpan

type FfiDestroyerMapUint64CounterSpan struct{}

func (FfiDestroyerMapUint64CounterSpan) Destroy

func (_ FfiDestroyerMapUint64CounterSpan) Destroy(mapValue map[uint64]CounterSpan)

type FfiDestroyerMapUint64Int32

type FfiDestroyerMapUint64Int32 struct{}

func (FfiDestroyerMapUint64Int32) Destroy

func (_ FfiDestroyerMapUint64Int32) Destroy(mapValue map[uint64]int32)

type FfiDestroyerMapUint64PeerInfo

type FfiDestroyerMapUint64PeerInfo struct{}

func (FfiDestroyerMapUint64PeerInfo) Destroy

func (_ FfiDestroyerMapUint64PeerInfo) Destroy(mapValue map[uint64]PeerInfo)

type FfiDestroyerOnPop

type FfiDestroyerOnPop struct{}

func (FfiDestroyerOnPop) Destroy

func (_ FfiDestroyerOnPop) Destroy(value OnPop)

type FfiDestroyerOnPush

type FfiDestroyerOnPush struct{}

func (FfiDestroyerOnPush) Destroy

func (_ FfiDestroyerOnPush) Destroy(value OnPush)

type FfiDestroyerOptionalChangeMeta

type FfiDestroyerOptionalChangeMeta struct{}

func (FfiDestroyerOptionalChangeMeta) Destroy

func (_ FfiDestroyerOptionalChangeMeta) Destroy(value *ChangeMeta)

type FfiDestroyerOptionalContainerId

type FfiDestroyerOptionalContainerId struct{}

func (FfiDestroyerOptionalContainerId) Destroy

func (_ FfiDestroyerOptionalContainerId) Destroy(value *ContainerId)

type FfiDestroyerOptionalContainerType

type FfiDestroyerOptionalContainerType struct{}

func (FfiDestroyerOptionalContainerType) Destroy

type FfiDestroyerOptionalCounterSpan

type FfiDestroyerOptionalCounterSpan struct{}

func (FfiDestroyerOptionalCounterSpan) Destroy

func (_ FfiDestroyerOptionalCounterSpan) Destroy(value *CounterSpan)

type FfiDestroyerOptionalCursor

type FfiDestroyerOptionalCursor struct{}

func (FfiDestroyerOptionalCursor) Destroy

func (_ FfiDestroyerOptionalCursor) Destroy(value **Cursor)

type FfiDestroyerOptionalDiff

type FfiDestroyerOptionalDiff struct{}

func (FfiDestroyerOptionalDiff) Destroy

func (_ FfiDestroyerOptionalDiff) Destroy(value *Diff)

type FfiDestroyerOptionalDiffEvent

type FfiDestroyerOptionalDiffEvent struct{}

func (FfiDestroyerOptionalDiffEvent) Destroy

func (_ FfiDestroyerOptionalDiffEvent) Destroy(value *DiffEvent)

type FfiDestroyerOptionalFloat64

type FfiDestroyerOptionalFloat64 struct{}

func (FfiDestroyerOptionalFloat64) Destroy

func (_ FfiDestroyerOptionalFloat64) Destroy(value *float64)

type FfiDestroyerOptionalFrontiers

type FfiDestroyerOptionalFrontiers struct{}

func (FfiDestroyerOptionalFrontiers) Destroy

func (_ FfiDestroyerOptionalFrontiers) Destroy(value **Frontiers)

type FfiDestroyerOptionalId

type FfiDestroyerOptionalId struct{}

func (FfiDestroyerOptionalId) Destroy

func (_ FfiDestroyerOptionalId) Destroy(value *Id)

type FfiDestroyerOptionalInt32

type FfiDestroyerOptionalInt32 struct{}

func (FfiDestroyerOptionalInt32) Destroy

func (_ FfiDestroyerOptionalInt32) Destroy(value *int32)

type FfiDestroyerOptionalInt64

type FfiDestroyerOptionalInt64 struct{}

func (FfiDestroyerOptionalInt64) Destroy

func (_ FfiDestroyerOptionalInt64) Destroy(value *int64)

type FfiDestroyerOptionalLoroCounter

type FfiDestroyerOptionalLoroCounter struct{}

func (FfiDestroyerOptionalLoroCounter) Destroy

func (_ FfiDestroyerOptionalLoroCounter) Destroy(value **LoroCounter)

type FfiDestroyerOptionalLoroDoc

type FfiDestroyerOptionalLoroDoc struct{}

func (FfiDestroyerOptionalLoroDoc) Destroy

func (_ FfiDestroyerOptionalLoroDoc) Destroy(value **LoroDoc)

type FfiDestroyerOptionalLoroList

type FfiDestroyerOptionalLoroList struct{}

func (FfiDestroyerOptionalLoroList) Destroy

func (_ FfiDestroyerOptionalLoroList) Destroy(value **LoroList)

type FfiDestroyerOptionalLoroMap

type FfiDestroyerOptionalLoroMap struct{}

func (FfiDestroyerOptionalLoroMap) Destroy

func (_ FfiDestroyerOptionalLoroMap) Destroy(value **LoroMap)

type FfiDestroyerOptionalLoroMovableList

type FfiDestroyerOptionalLoroMovableList struct{}

func (FfiDestroyerOptionalLoroMovableList) Destroy

type FfiDestroyerOptionalLoroText

type FfiDestroyerOptionalLoroText struct{}

func (FfiDestroyerOptionalLoroText) Destroy

func (_ FfiDestroyerOptionalLoroText) Destroy(value **LoroText)

type FfiDestroyerOptionalLoroTree

type FfiDestroyerOptionalLoroTree struct{}

func (FfiDestroyerOptionalLoroTree) Destroy

func (_ FfiDestroyerOptionalLoroTree) Destroy(value **LoroTree)

type FfiDestroyerOptionalLoroUnknown

type FfiDestroyerOptionalLoroUnknown struct{}

func (FfiDestroyerOptionalLoroUnknown) Destroy

func (_ FfiDestroyerOptionalLoroUnknown) Destroy(value **LoroUnknown)

type FfiDestroyerOptionalLoroValue

type FfiDestroyerOptionalLoroValue struct{}

func (FfiDestroyerOptionalLoroValue) Destroy

func (_ FfiDestroyerOptionalLoroValue) Destroy(value *LoroValue)

type FfiDestroyerOptionalMapStringLoroValue

type FfiDestroyerOptionalMapStringLoroValue struct{}

func (FfiDestroyerOptionalMapStringLoroValue) Destroy

type FfiDestroyerOptionalMapUint64CounterSpan

type FfiDestroyerOptionalMapUint64CounterSpan struct{}

func (FfiDestroyerOptionalMapUint64CounterSpan) Destroy

type FfiDestroyerOptionalOnPop

type FfiDestroyerOptionalOnPop struct{}

func (FfiDestroyerOptionalOnPop) Destroy

func (_ FfiDestroyerOptionalOnPop) Destroy(value *OnPop)

type FfiDestroyerOptionalOnPush

type FfiDestroyerOptionalOnPush struct{}

func (FfiDestroyerOptionalOnPush) Destroy

func (_ FfiDestroyerOptionalOnPush) Destroy(value *OnPush)

type FfiDestroyerOptionalOrdering

type FfiDestroyerOptionalOrdering struct{}

func (FfiDestroyerOptionalOrdering) Destroy

func (_ FfiDestroyerOptionalOrdering) Destroy(value *Ordering)

type FfiDestroyerOptionalSequenceContainerPath

type FfiDestroyerOptionalSequenceContainerPath struct{}

func (FfiDestroyerOptionalSequenceContainerPath) Destroy

type FfiDestroyerOptionalSequenceTreeId

type FfiDestroyerOptionalSequenceTreeId struct{}

func (FfiDestroyerOptionalSequenceTreeId) Destroy

func (_ FfiDestroyerOptionalSequenceTreeId) Destroy(value *[]TreeId)

type FfiDestroyerOptionalString

type FfiDestroyerOptionalString struct{}

func (FfiDestroyerOptionalString) Destroy

func (_ FfiDestroyerOptionalString) Destroy(value *string)

type FfiDestroyerOptionalStyleConfig

type FfiDestroyerOptionalStyleConfig struct{}

func (FfiDestroyerOptionalStyleConfig) Destroy

func (_ FfiDestroyerOptionalStyleConfig) Destroy(value *StyleConfig)

type FfiDestroyerOptionalSubscription

type FfiDestroyerOptionalSubscription struct{}

func (FfiDestroyerOptionalSubscription) Destroy

type FfiDestroyerOptionalUint32

type FfiDestroyerOptionalUint32 struct{}

func (FfiDestroyerOptionalUint32) Destroy

func (_ FfiDestroyerOptionalUint32) Destroy(value *uint32)

type FfiDestroyerOptionalUint64

type FfiDestroyerOptionalUint64 struct{}

func (FfiDestroyerOptionalUint64) Destroy

func (_ FfiDestroyerOptionalUint64) Destroy(value *uint64)

type FfiDestroyerOptionalUndoItemMeta

type FfiDestroyerOptionalUndoItemMeta struct{}

func (FfiDestroyerOptionalUndoItemMeta) Destroy

type FfiDestroyerOptionalValueOrContainer

type FfiDestroyerOptionalValueOrContainer struct{}

func (FfiDestroyerOptionalValueOrContainer) Destroy

type FfiDestroyerOptionalVersionVector

type FfiDestroyerOptionalVersionVector struct{}

func (FfiDestroyerOptionalVersionVector) Destroy

type FfiDestroyerOrdering

type FfiDestroyerOrdering struct{}

func (FfiDestroyerOrdering) Destroy

func (_ FfiDestroyerOrdering) Destroy(value Ordering)

type FfiDestroyerPathItem

type FfiDestroyerPathItem struct{}

func (FfiDestroyerPathItem) Destroy

func (_ FfiDestroyerPathItem) Destroy(value PathItem)

type FfiDestroyerPeerInfo

type FfiDestroyerPeerInfo struct{}

func (FfiDestroyerPeerInfo) Destroy

func (_ FfiDestroyerPeerInfo) Destroy(value PeerInfo)

type FfiDestroyerPosQueryResult

type FfiDestroyerPosQueryResult struct{}

func (FfiDestroyerPosQueryResult) Destroy

func (_ FfiDestroyerPosQueryResult) Destroy(value PosQueryResult)

type FfiDestroyerPosType added in v0.2.0

type FfiDestroyerPosType struct{}

func (FfiDestroyerPosType) Destroy added in v0.2.0

func (_ FfiDestroyerPosType) Destroy(value PosType)

type FfiDestroyerPreCommitCallback

type FfiDestroyerPreCommitCallback struct{}

func (FfiDestroyerPreCommitCallback) Destroy

type FfiDestroyerPreCommitCallbackPayload

type FfiDestroyerPreCommitCallbackPayload struct{}

func (FfiDestroyerPreCommitCallbackPayload) Destroy

type FfiDestroyerSequenceBytes

type FfiDestroyerSequenceBytes struct{}

func (FfiDestroyerSequenceBytes) Destroy

func (FfiDestroyerSequenceBytes) Destroy(sequence [][]byte)

type FfiDestroyerSequenceContainerDiff

type FfiDestroyerSequenceContainerDiff struct{}

func (FfiDestroyerSequenceContainerDiff) Destroy

type FfiDestroyerSequenceContainerId

type FfiDestroyerSequenceContainerId struct{}

func (FfiDestroyerSequenceContainerId) Destroy

func (FfiDestroyerSequenceContainerId) Destroy(sequence []ContainerId)

type FfiDestroyerSequenceContainerIdAndDiff

type FfiDestroyerSequenceContainerIdAndDiff struct{}

func (FfiDestroyerSequenceContainerIdAndDiff) Destroy

type FfiDestroyerSequenceContainerPath

type FfiDestroyerSequenceContainerPath struct{}

func (FfiDestroyerSequenceContainerPath) Destroy

type FfiDestroyerSequenceCursorWithPos

type FfiDestroyerSequenceCursorWithPos struct{}

func (FfiDestroyerSequenceCursorWithPos) Destroy

type FfiDestroyerSequenceId

type FfiDestroyerSequenceId struct{}

func (FfiDestroyerSequenceId) Destroy

func (FfiDestroyerSequenceId) Destroy(sequence []Id)

type FfiDestroyerSequenceIdSpan

type FfiDestroyerSequenceIdSpan struct{}

func (FfiDestroyerSequenceIdSpan) Destroy

func (FfiDestroyerSequenceIdSpan) Destroy(sequence []IdSpan)

type FfiDestroyerSequenceIndex

type FfiDestroyerSequenceIndex struct{}

func (FfiDestroyerSequenceIndex) Destroy

func (FfiDestroyerSequenceIndex) Destroy(sequence []Index)

type FfiDestroyerSequenceListDiffItem

type FfiDestroyerSequenceListDiffItem struct{}

func (FfiDestroyerSequenceListDiffItem) Destroy

func (FfiDestroyerSequenceListDiffItem) Destroy(sequence []ListDiffItem)

type FfiDestroyerSequenceLoroValue

type FfiDestroyerSequenceLoroValue struct{}

func (FfiDestroyerSequenceLoroValue) Destroy

func (FfiDestroyerSequenceLoroValue) Destroy(sequence []LoroValue)

type FfiDestroyerSequencePathItem

type FfiDestroyerSequencePathItem struct{}

func (FfiDestroyerSequencePathItem) Destroy

func (FfiDestroyerSequencePathItem) Destroy(sequence []PathItem)

type FfiDestroyerSequenceString

type FfiDestroyerSequenceString struct{}

func (FfiDestroyerSequenceString) Destroy

func (FfiDestroyerSequenceString) Destroy(sequence []string)

type FfiDestroyerSequenceTextDelta

type FfiDestroyerSequenceTextDelta struct{}

func (FfiDestroyerSequenceTextDelta) Destroy

func (FfiDestroyerSequenceTextDelta) Destroy(sequence []TextDelta)

type FfiDestroyerSequenceTreeDiffItem

type FfiDestroyerSequenceTreeDiffItem struct{}

func (FfiDestroyerSequenceTreeDiffItem) Destroy

func (FfiDestroyerSequenceTreeDiffItem) Destroy(sequence []TreeDiffItem)

type FfiDestroyerSequenceTreeId

type FfiDestroyerSequenceTreeId struct{}

func (FfiDestroyerSequenceTreeId) Destroy

func (FfiDestroyerSequenceTreeId) Destroy(sequence []TreeId)

type FfiDestroyerSequenceUint64

type FfiDestroyerSequenceUint64 struct{}

func (FfiDestroyerSequenceUint64) Destroy

func (FfiDestroyerSequenceUint64) Destroy(sequence []uint64)

type FfiDestroyerSequenceValueOrContainer

type FfiDestroyerSequenceValueOrContainer struct{}

func (FfiDestroyerSequenceValueOrContainer) Destroy

type FfiDestroyerSequenceVersionRangeItem

type FfiDestroyerSequenceVersionRangeItem struct{}

func (FfiDestroyerSequenceVersionRangeItem) Destroy

type FfiDestroyerSide

type FfiDestroyerSide struct{}

func (FfiDestroyerSide) Destroy

func (_ FfiDestroyerSide) Destroy(value Side)

type FfiDestroyerString

type FfiDestroyerString struct{}

func (FfiDestroyerString) Destroy

func (FfiDestroyerString) Destroy(_ string)

type FfiDestroyerStyleConfig

type FfiDestroyerStyleConfig struct{}

func (FfiDestroyerStyleConfig) Destroy

func (_ FfiDestroyerStyleConfig) Destroy(value StyleConfig)

type FfiDestroyerStyleConfigMap

type FfiDestroyerStyleConfigMap struct{}

func (FfiDestroyerStyleConfigMap) Destroy

func (_ FfiDestroyerStyleConfigMap) Destroy(value *StyleConfigMap)

type FfiDestroyerSubscriber

type FfiDestroyerSubscriber struct{}

func (FfiDestroyerSubscriber) Destroy

func (_ FfiDestroyerSubscriber) Destroy(value Subscriber)

type FfiDestroyerSubscription

type FfiDestroyerSubscription struct{}

func (FfiDestroyerSubscription) Destroy

func (_ FfiDestroyerSubscription) Destroy(value *Subscription)

type FfiDestroyerTextDelta

type FfiDestroyerTextDelta struct{}

func (FfiDestroyerTextDelta) Destroy

func (_ FfiDestroyerTextDelta) Destroy(value TextDelta)

type FfiDestroyerTreeDiff

type FfiDestroyerTreeDiff struct{}

func (FfiDestroyerTreeDiff) Destroy

func (_ FfiDestroyerTreeDiff) Destroy(value TreeDiff)

type FfiDestroyerTreeDiffItem

type FfiDestroyerTreeDiffItem struct{}

func (FfiDestroyerTreeDiffItem) Destroy

func (_ FfiDestroyerTreeDiffItem) Destroy(value TreeDiffItem)

type FfiDestroyerTreeExternalDiff

type FfiDestroyerTreeExternalDiff struct{}

func (FfiDestroyerTreeExternalDiff) Destroy

type FfiDestroyerTreeId

type FfiDestroyerTreeId struct{}

func (FfiDestroyerTreeId) Destroy

func (_ FfiDestroyerTreeId) Destroy(value TreeId)

type FfiDestroyerTreeParentId

type FfiDestroyerTreeParentId struct{}

func (FfiDestroyerTreeParentId) Destroy

func (_ FfiDestroyerTreeParentId) Destroy(value TreeParentId)

type FfiDestroyerUint8

type FfiDestroyerUint8 struct{}

func (FfiDestroyerUint8) Destroy

func (FfiDestroyerUint8) Destroy(_ uint8)

type FfiDestroyerUint32

type FfiDestroyerUint32 struct{}

func (FfiDestroyerUint32) Destroy

func (FfiDestroyerUint32) Destroy(_ uint32)

type FfiDestroyerUint64

type FfiDestroyerUint64 struct{}

func (FfiDestroyerUint64) Destroy

func (FfiDestroyerUint64) Destroy(_ uint64)

type FfiDestroyerUndoItemMeta

type FfiDestroyerUndoItemMeta struct{}

func (FfiDestroyerUndoItemMeta) Destroy

func (_ FfiDestroyerUndoItemMeta) Destroy(value UndoItemMeta)

type FfiDestroyerUndoManager

type FfiDestroyerUndoManager struct{}

func (FfiDestroyerUndoManager) Destroy

func (_ FfiDestroyerUndoManager) Destroy(value *UndoManager)

type FfiDestroyerUndoOrRedo

type FfiDestroyerUndoOrRedo struct{}

func (FfiDestroyerUndoOrRedo) Destroy

func (_ FfiDestroyerUndoOrRedo) Destroy(value UndoOrRedo)

type FfiDestroyerUnsubscriber

type FfiDestroyerUnsubscriber struct{}

func (FfiDestroyerUnsubscriber) Destroy

func (_ FfiDestroyerUnsubscriber) Destroy(value Unsubscriber)

type FfiDestroyerUpdateOptions

type FfiDestroyerUpdateOptions struct{}

func (FfiDestroyerUpdateOptions) Destroy

func (_ FfiDestroyerUpdateOptions) Destroy(value UpdateOptions)

type FfiDestroyerUpdateTimeoutError

type FfiDestroyerUpdateTimeoutError struct{}

func (FfiDestroyerUpdateTimeoutError) Destroy

type FfiDestroyerValueOrContainer

type FfiDestroyerValueOrContainer struct{}

func (FfiDestroyerValueOrContainer) Destroy

type FfiDestroyerVersionRange

type FfiDestroyerVersionRange struct{}

func (FfiDestroyerVersionRange) Destroy

func (_ FfiDestroyerVersionRange) Destroy(value *VersionRange)

type FfiDestroyerVersionRangeItem

type FfiDestroyerVersionRangeItem struct{}

func (FfiDestroyerVersionRangeItem) Destroy

type FfiDestroyerVersionVector

type FfiDestroyerVersionVector struct{}

func (FfiDestroyerVersionVector) Destroy

func (_ FfiDestroyerVersionVector) Destroy(value *VersionVector)

type FfiDestroyerVersionVectorDiff

type FfiDestroyerVersionVectorDiff struct{}

func (FfiDestroyerVersionVectorDiff) Destroy

type FfiObject

type FfiObject struct {
	// contains filtered or unexported fields
}

type FirstCommitFromPeerCallback

type FirstCommitFromPeerCallback interface {
	OnFirstCommitFromPeer(payload FirstCommitFromPeerPayload)
}

func AsFirstCommitFromPeerCallback

func AsFirstCommitFromPeerCallback(fn FirstCommitFromPeerCallbackFn) FirstCommitFromPeerCallback

AsFirstCommitFromPeerCallback adapts a function to the FirstCommitFromPeerCallback interface.

func LiftFromExternalFirstCommitFromPeerCallback added in v0.3.0

func LiftFromExternalFirstCommitFromPeerCallback(handle uint64) FirstCommitFromPeerCallback

type FirstCommitFromPeerCallbackFn

type FirstCommitFromPeerCallbackFn func(payload FirstCommitFromPeerPayload)

FirstCommitFromPeerCallbackFn adapts a function to the FirstCommitFromPeerCallback interface.

Use with LoroDoc.SubscribeFirstCommitFromPeer to detect when a new peer starts contributing to the document for the first time.

sub := doc.SubscribeFirstCommitFromPeer(loro.FirstCommitFromPeerCallbackFn(
	func(payload loro.FirstCommitFromPeerPayload) {
		fmt.Println("new peer joined:", payload.PeerId)
	},
))
defer sub.Unsubscribe()

func (FirstCommitFromPeerCallbackFn) OnFirstCommitFromPeer

func (fn FirstCommitFromPeerCallbackFn) OnFirstCommitFromPeer(payload FirstCommitFromPeerPayload)

type FirstCommitFromPeerCallbackImpl

type FirstCommitFromPeerCallbackImpl struct {
	// contains filtered or unexported fields
}

func (*FirstCommitFromPeerCallbackImpl) Destroy

func (object *FirstCommitFromPeerCallbackImpl) Destroy()

func (*FirstCommitFromPeerCallbackImpl) OnFirstCommitFromPeer

func (_self *FirstCommitFromPeerCallbackImpl) OnFirstCommitFromPeer(payload FirstCommitFromPeerPayload)

type FirstCommitFromPeerPayload

type FirstCommitFromPeerPayload struct {
	Peer uint64
}

func (*FirstCommitFromPeerPayload) Destroy

func (r *FirstCommitFromPeerPayload) Destroy()

type FractionalIndex

type FractionalIndex struct {
	// contains filtered or unexported fields
}

func FractionalIndexFromBytes

func FractionalIndexFromBytes(bytes []byte) *FractionalIndex

func FractionalIndexFromHexString

func FractionalIndexFromHexString(str string) *FractionalIndex

func LiftFromExternalFractionalIndex added in v0.3.0

func LiftFromExternalFractionalIndex(handle uint64) *FractionalIndex

func (*FractionalIndex) Destroy

func (object *FractionalIndex) Destroy()

func (*FractionalIndex) String added in v0.2.0

func (_self *FractionalIndex) String() string

type FractionalIndexInterface

type FractionalIndexInterface interface {
}

type Frontiers

type Frontiers struct {
	// contains filtered or unexported fields
}

func FrontiersDecode

func FrontiersDecode(bytes []byte) (*Frontiers, error)

func FrontiersFromId

func FrontiersFromId(id Id) *Frontiers

func FrontiersFromIds

func FrontiersFromIds(ids []Id) *Frontiers

func LiftFromExternalFrontiers added in v0.3.0

func LiftFromExternalFrontiers(handle uint64) *Frontiers

func NewFrontiers

func NewFrontiers() *Frontiers

func (*Frontiers) Destroy

func (object *Frontiers) Destroy()

func (*Frontiers) Encode

func (_self *Frontiers) Encode() []byte

func (*Frontiers) Eq

func (_self *Frontiers) Eq(other *Frontiers) bool

func (*Frontiers) IsEmpty

func (_self *Frontiers) IsEmpty() bool

func (*Frontiers) String added in v0.4.0

func (f *Frontiers) String() string

func (*Frontiers) ToVec

func (_self *Frontiers) ToVec() []Id

type FrontiersInterface

type FrontiersInterface interface {
	Encode() []byte
	Eq(other *Frontiers) bool
	IsEmpty() bool
	ToVec() []Id
}

type FrontiersOrId

type FrontiersOrId struct {
	Frontiers **Frontiers
	Id        *Id
}

func (*FrontiersOrId) Destroy

func (r *FrontiersOrId) Destroy()

type GoRustBuffer

type GoRustBuffer struct {
	// contains filtered or unexported fields
}

This is needed, because as of go 1.24 type RustBuffer C.RustBuffer cannot have methods, RustBuffer is treated as non-local type

func RustBufferFromExternal

func RustBufferFromExternal(b ExternalCRustBuffer) GoRustBuffer

func (GoRustBuffer) AsReader

func (cb GoRustBuffer) AsReader() *bytes.Reader

func (GoRustBuffer) Capacity

func (cb GoRustBuffer) Capacity() uint64

func (GoRustBuffer) Data

func (cb GoRustBuffer) Data() unsafe.Pointer

func (GoRustBuffer) Free

func (cb GoRustBuffer) Free()

func (GoRustBuffer) Len

func (cb GoRustBuffer) Len() uint64

func (GoRustBuffer) ToGoBytes

func (cb GoRustBuffer) ToGoBytes() []byte

type Id

type Id struct {
	Peer    uint64
	Counter int32
}

func (*Id) Destroy

func (r *Id) Destroy()

func (Id) String added in v0.4.0

func (id Id) String() string

type IdLp

type IdLp struct {
	Lamport uint32
	Peer    uint64
}

func (*IdLp) Destroy

func (r *IdLp) Destroy()

func (IdLp) String added in v0.4.0

func (id IdLp) String() string

type IdSpan

type IdSpan struct {
	Peer    uint64
	Counter CounterSpan
}

func (*IdSpan) Destroy

func (r *IdSpan) Destroy()

func (IdSpan) String added in v0.4.0

func (s IdSpan) String() string

type ImportBlobMetadata

type ImportBlobMetadata struct {
	// The partial start version vector.
	//
	// Import blob includes all the ops from `partial_start_vv` to `partial_end_vv`.
	// However, it does not constitute a complete version vector, as it only contains counters
	// from peers included within the import blob.
	PartialStartVv *VersionVector
	// The partial end version vector.
	//
	// Import blob includes all the ops from `partial_start_vv` to `partial_end_vv`.
	// However, it does not constitute a complete version vector, as it only contains counters
	// from peers included within the import blob.
	PartialEndVv   *VersionVector
	StartTimestamp int64
	StartFrontiers *Frontiers
	EndTimestamp   int64
	ChangeNum      uint32
	Mode           string
}

func DecodeImportBlobMeta

func DecodeImportBlobMeta(bytes []byte, checkChecksum bool) (ImportBlobMetadata, error)

Decodes the metadata for an imported blob from the provided bytes.

func (*ImportBlobMetadata) Destroy

func (r *ImportBlobMetadata) Destroy()

type ImportStatus

type ImportStatus struct {
	Success map[uint64]CounterSpan
	Pending *map[uint64]CounterSpan
}

func (*ImportStatus) Destroy

func (r *ImportStatus) Destroy()

type Index

type Index interface {
	Destroy()
}

func PathKey added in v0.4.0

func PathKey(k string) Index

PathKey returns an Index that selects a map key. Equivalent to IndexKey{Key: k} but avoids the struct literal.

func PathNode added in v0.4.0

func PathNode(id TreeId) Index

PathNode returns an Index that selects a tree node by TreeId. Equivalent to IndexNode{Target: id}.

func PathSeq added in v0.4.0

func PathSeq(i uint32) Index

PathSeq returns an Index that selects a list/movable-list position. Equivalent to IndexSeq{Index: i}.

type IndexKey

type IndexKey struct {
	Key string
}

func (IndexKey) Destroy

func (e IndexKey) Destroy()

func (IndexKey) String added in v0.4.0

func (e IndexKey) String() string

type IndexNode

type IndexNode struct {
	Target TreeId
}

func (IndexNode) Destroy

func (e IndexNode) Destroy()

func (IndexNode) String added in v0.4.0

func (e IndexNode) String() string

type IndexSeq

type IndexSeq struct {
	Index uint32
}

func (IndexSeq) Destroy

func (e IndexSeq) Destroy()

func (IndexSeq) String added in v0.4.0

func (e IndexSeq) String() string

type JsonPathError

type JsonPathError struct {
	// contains filtered or unexported fields
}

func NewJsonPathErrorEvaluationError

func NewJsonPathErrorEvaluationError() *JsonPathError

func NewJsonPathErrorInvalidJsonPath

func NewJsonPathErrorInvalidJsonPath() *JsonPathError

func (*JsonPathError) AsError

func (err *JsonPathError) AsError() error

Convenience method to turn *JsonPathError into error Avoiding treating nil pointer as non nil error interface

func (JsonPathError) Error

func (err JsonPathError) Error() string

func (JsonPathError) Unwrap

func (err JsonPathError) Unwrap() error

type JsonPathErrorEvaluationError

type JsonPathErrorEvaluationError struct {
	// contains filtered or unexported fields
}

func (JsonPathErrorEvaluationError) Error

func (JsonPathErrorEvaluationError) Is

func (self JsonPathErrorEvaluationError) Is(target error) bool

type JsonPathErrorInvalidJsonPath

type JsonPathErrorInvalidJsonPath struct {
	// contains filtered or unexported fields
}

Variant structs

func (JsonPathErrorInvalidJsonPath) Error

func (JsonPathErrorInvalidJsonPath) Is

func (self JsonPathErrorInvalidJsonPath) Is(target error) bool

type JsonPathSubscriber added in v0.2.0

type JsonPathSubscriber interface {
	// Called when a change may affect the subscribed JSONPath query.
	OnJsonpathChanged()
}

func AsJsonPathSubscriber added in v0.4.0

func AsJsonPathSubscriber(fn JsonPathSubscriberFn) JsonPathSubscriber

AsJsonPathSubscriber adapts a function to the JsonPathSubscriber interface.

func LiftFromExternalJsonPathSubscriber added in v0.3.0

func LiftFromExternalJsonPathSubscriber(handle uint64) JsonPathSubscriber

type JsonPathSubscriberFn added in v0.4.0

type JsonPathSubscriberFn func()

JsonPathSubscriberFn adapts a function to the JsonPathSubscriber interface.

Use with LoroDoc.SubscribeJsonpath to be notified when a change might affect the result of a JSONPath query. The callback receives no arguments; re-evaluate the query to get the updated result.

sub, err := doc.SubscribeJsonpath("$.users[*].name", loro.JsonPathSubscriberFn(func() {
	// a change may have affected the query result, re-evaluate it
	results := doc.JsonpathQuery("$.users[*].name")
	fmt.Println("names:", results)
}))
if err != nil {
	log.Fatal(err)
}
defer sub.Unsubscribe()

func (JsonPathSubscriberFn) OnJsonpathChanged added in v0.4.0

func (fn JsonPathSubscriberFn) OnJsonpathChanged()

type JsonPathSubscriberImpl added in v0.2.0

type JsonPathSubscriberImpl struct {
	// contains filtered or unexported fields
}

func (*JsonPathSubscriberImpl) Destroy added in v0.2.0

func (object *JsonPathSubscriberImpl) Destroy()

func (*JsonPathSubscriberImpl) OnJsonpathChanged added in v0.2.0

func (_self *JsonPathSubscriberImpl) OnJsonpathChanged()

Called when a change may affect the subscribed JSONPath query.

type ListDiffItem

type ListDiffItem interface {
	Destroy()
}

type ListDiffItemDelete

type ListDiffItemDelete struct {
	Delete uint32
}

Delete n elements from the list at the current index.

func (ListDiffItemDelete) Destroy

func (e ListDiffItemDelete) Destroy()

type ListDiffItemInsert

type ListDiffItemInsert struct {
	Insert []*ValueOrContainer
	IsMove bool
}

Insert a new element into the list.

func (ListDiffItemInsert) Destroy

func (e ListDiffItemInsert) Destroy()

type ListDiffItemRetain

type ListDiffItemRetain struct {
	Retain uint32
}

Retain n elements in the list.

This is used to keep the current index unchanged.

func (ListDiffItemRetain) Destroy

func (e ListDiffItemRetain) Destroy()

type LocalEphemeralListener

type LocalEphemeralListener interface {
	OnEphemeralUpdate(update []byte)
}

func AsLocalEphemeralListener

func AsLocalEphemeralListener(fn LocalEphemeralListenerFn) LocalEphemeralListener

AsLocalEphemeralListener adapts a function to the LocalEphemeralListener interface.

func LiftFromExternalLocalEphemeralListener added in v0.3.0

func LiftFromExternalLocalEphemeralListener(handle uint64) LocalEphemeralListener

type LocalEphemeralListenerFn

type LocalEphemeralListenerFn func(update []byte)

LocalEphemeralListenerFn adapts a function to the LocalEphemeralListener interface.

Use with EphemeralStore.SubscribeLocalUpdate to receive raw ephemeral update bytes whenever the local ephemeral store changes. Useful for broadcasting awareness data (e.g. cursor positions) to other peers.

sub := store.SubscribeLocalUpdate(loro.LocalEphemeralListenerFn(func(update []byte) {
	_ = conn.Send(update) // broadcast ephemeral update
}))
defer sub.Unsubscribe()

func (LocalEphemeralListenerFn) OnEphemeralUpdate

func (fn LocalEphemeralListenerFn) OnEphemeralUpdate(update []byte)

type LocalEphemeralListenerImpl

type LocalEphemeralListenerImpl struct {
	// contains filtered or unexported fields
}

func (*LocalEphemeralListenerImpl) Destroy

func (object *LocalEphemeralListenerImpl) Destroy()

func (*LocalEphemeralListenerImpl) OnEphemeralUpdate

func (_self *LocalEphemeralListenerImpl) OnEphemeralUpdate(update []byte)

type LocalUpdateCallback

type LocalUpdateCallback interface {
	OnLocalUpdate(update []byte)
}

func AsLocalUpdateCallback

func AsLocalUpdateCallback(fn LocalUpdateCallbackFn) LocalUpdateCallback

AsLocalUpdateCallback adapts a function to the LocalUpdateCallback interface.

func LiftFromExternalLocalUpdateCallback added in v0.3.0

func LiftFromExternalLocalUpdateCallback(handle uint64) LocalUpdateCallback

type LocalUpdateCallbackFn

type LocalUpdateCallbackFn func(update []byte)

LocalUpdateCallbackFn adapts a function to the LocalUpdateCallback interface.

Use with LoroDoc.SubscribeLocalUpdate to receive raw update bytes whenever the local document changes. Useful for syncing updates to a remote peer or persisting them to storage.

sub := doc.SubscribeLocalUpdate(loro.LocalUpdateCallbackFn(func(update []byte) {
	_ = conn.Send(update) // send update to a remote peer
}))
defer sub.Unsubscribe()

func (LocalUpdateCallbackFn) OnLocalUpdate

func (fn LocalUpdateCallbackFn) OnLocalUpdate(update []byte)

type LocalUpdateCallbackImpl

type LocalUpdateCallbackImpl struct {
	// contains filtered or unexported fields
}

func (*LocalUpdateCallbackImpl) Destroy

func (object *LocalUpdateCallbackImpl) Destroy()

func (*LocalUpdateCallbackImpl) OnLocalUpdate

func (_self *LocalUpdateCallbackImpl) OnLocalUpdate(update []byte)

type LoroCounter

type LoroCounter struct {
	// contains filtered or unexported fields
}

func GetLoroCounterContainer

func GetLoroCounterContainer(v **ValueOrContainer) (*LoroCounter, bool)

GetLoroCounterContainer takes a pointer to a ValueOrContainer and returns the LoroCounter value if it is a LoroCounter.

func LiftFromExternalLoroCounter added in v0.3.0

func LiftFromExternalLoroCounter(handle uint64) *LoroCounter

func NewLoroCounter

func NewLoroCounter() *LoroCounter

Create a new Counter.

func (*LoroCounter) Attached added in v0.4.0

func (c *LoroCounter) Attached() *LoroCounter

Attached returns the live attached version of this container, or nil if the container has been detached and has no attached counterpart.

func (*LoroCounter) Decrement

func (_self *LoroCounter) Decrement(value float64) error

Decrement the counter by the given value.

func (*LoroCounter) Destroy

func (object *LoroCounter) Destroy()

func (*LoroCounter) Doc

func (_self *LoroCounter) Doc() **LoroDoc

Get the LoroDoc from this container

func (*LoroCounter) GetAttached

func (_self *LoroCounter) GetAttached() **LoroCounter

If a detached container is attached, this method will return its corresponding attached handler.

func (*LoroCounter) GetValue

func (_self *LoroCounter) GetValue() float64

Get the current value of the counter.

func (*LoroCounter) Id

func (_self *LoroCounter) Id() ContainerId

Return container id of the Counter.

func (*LoroCounter) Increment

func (_self *LoroCounter) Increment(value float64) error

Increment the counter by the given value.

func (*LoroCounter) IsAttached

func (_self *LoroCounter) IsAttached() bool

Whether the container is attached to a document

The edits on a detached container will not be persisted. To attach the container to the document, please insert it into an attached container.

func (*LoroCounter) IsDeleted

func (_self *LoroCounter) IsDeleted() bool

Whether the container is deleted.

func (*LoroCounter) OwnerDoc added in v0.4.0

func (c *LoroCounter) OwnerDoc() *LoroDoc

OwnerDoc returns the LoroDoc this container is attached to, or nil if it is detached.

func (*LoroCounter) Subscribe

func (_self *LoroCounter) Subscribe(subscriber Subscriber) **Subscription

Subscribe the events of a container.

The callback will be invoked when the container is changed. Returns a subscription that can be used to unsubscribe.

The events will be emitted after a transaction is committed. A transaction is committed when:

- `doc.commit()` is called. - `doc.export(mode)` is called. - `doc.import(data)` is called. - `doc.checkout(version)` is called.

func (*LoroCounter) SubscribeFn added in v0.4.0

func (c *LoroCounter) SubscribeFn(fn func(diff DiffEvent)) *Subscription

SubscribeFn is a convenience wrapper around LoroCounter.Subscribe that accepts a plain function instead of a Subscriber interface. Returns nil if the container is detached.

sub := counter.SubscribeFn(func(diff loro.DiffEvent) {
	fmt.Println("counter changed")
})
if sub != nil {
	defer sub.Unsubscribe()
}

type LoroCounterInterface

type LoroCounterInterface interface {
	// Decrement the counter by the given value.
	Decrement(value float64) error
	// Get the LoroDoc from this container
	Doc() **LoroDoc
	// If a detached container is attached, this method will return its corresponding attached handler.
	GetAttached() **LoroCounter
	// Get the current value of the counter.
	GetValue() float64
	// Return container id of the Counter.
	Id() ContainerId
	// Increment the counter by the given value.
	Increment(value float64) error
	// Whether the container is attached to a document
	//
	// The edits on a detached container will not be persisted.
	// To attach the container to the document, please insert it into an attached container.
	IsAttached() bool
	// Whether the container is deleted.
	IsDeleted() bool
	// Subscribe the events of a container.
	//
	// The callback will be invoked when the container is changed.
	// Returns a subscription that can be used to unsubscribe.
	//
	// The events will be emitted after a transaction is committed. A transaction is committed when:
	//
	// - `doc.commit()` is called.
	// - `doc.export(mode)` is called.
	// - `doc.import(data)` is called.
	// - `doc.checkout(version)` is called.
	Subscribe(subscriber Subscriber) **Subscription
}

type LoroDoc

type LoroDoc struct {
	// contains filtered or unexported fields
}

`LoroDoc` is the entry for the whole document. When it's dropped, all the associated [`Handler`]s will be invalidated.

**Important:** Loro is a pure library and does not handle network protocols. It is the responsibility of the user to manage the storage, loading, and synchronization of the bytes exported by Loro in a manner suitable for their specific environment.

func LiftFromExternalLoroDoc added in v0.3.0

func LiftFromExternalLoroDoc(handle uint64) *LoroDoc

func NewLoroDoc

func NewLoroDoc() *LoroDoc

Create a new `LoroDoc` instance.

func (*LoroDoc) ApplyDiff

func (_self *LoroDoc) ApplyDiff(diff *DiffBatch) error

Apply a diff to the current document state.

Internally, it will apply the diff to the current state.

func (*LoroDoc) Attach

func (_self *LoroDoc) Attach()

Attach the document state to the latest known version.

> The document becomes detached during a `checkout` operation. > Being `detached` implies that the `DocState` is not synchronized with the latest version of the `OpLog`. > In a detached state, the document is not editable, and any `import` operations will be > recorded in the `OpLog` without being applied to the `DocState`.

func (*LoroDoc) CheckStateCorrectnessSlow

func (_self *LoroDoc) CheckStateCorrectnessSlow()

Check the correctness of the document state by comparing it with the state calculated by applying all the history.

func (*LoroDoc) Checkout

func (_self *LoroDoc) Checkout(frontiers *Frontiers) error

Checkout the `DocState` to a specific version.

The document becomes detached during a `checkout` operation. Being `detached` implies that the `DocState` is not synchronized with the latest version of the `OpLog`. In a detached state, the document is not editable, and any `import` operations will be recorded in the `OpLog` without being applied to the `DocState`.

You should call `attach` to attach the `DocState` to the latest version of `OpLog`.

func (*LoroDoc) CheckoutToLatest

func (_self *LoroDoc) CheckoutToLatest()

Checkout the `DocState` to the latest version.

> The document becomes detached during a `checkout` operation. > Being `detached` implies that the `DocState` is not synchronized with the latest version of the `OpLog`. > In a detached state, the document is not editable, and any `import` operations will be > recorded in the `OpLog` without being applied to the `DocState`.

This has the same effect as `attach`.

func (*LoroDoc) ClearNextCommitOptions

func (_self *LoroDoc) ClearNextCommitOptions()

Clear the options of the next commit.

func (*LoroDoc) CmpWithFrontiers

func (_self *LoroDoc) CmpWithFrontiers(other *Frontiers) Ordering

Compare the frontiers with the current OpLog's version.

If `other` contains any version that's not contained in the current OpLog, return [Ordering::Less].

func (*LoroDoc) Commit

func (_self *LoroDoc) Commit()

Commit the cumulative auto commit transaction.

There is a transaction behind every operation. The events will be emitted after a transaction is committed. A transaction is committed when:

- `doc.commit()` is called. - `doc.export(mode)` is called. - `doc.import(data)` is called. - `doc.checkout(version)` is called.

func (*LoroDoc) CommitWith

func (_self *LoroDoc) CommitWith(options CommitOptions)

func (*LoroDoc) CompactChangeStore

func (_self *LoroDoc) CompactChangeStore()

Encoded all ops and history cache to bytes and store them in the kv store.

The parsed ops will be dropped

func (*LoroDoc) Config

func (_self *LoroDoc) Config() *Configure

Get the configurations of the document.

func (*LoroDoc) ConfigDefaultTextStyle

func (_self *LoroDoc) ConfigDefaultTextStyle(textStyle *StyleConfig)

Configures the default text style for the document.

This method sets the default text style configuration for the document when using LoroText. If `None` is provided, the default style is reset.

Parameters

- `text_style`: The style configuration to set as the default. `None` to reset.

func (*LoroDoc) ConfigTextStyle

func (_self *LoroDoc) ConfigTextStyle(textStyle *StyleConfigMap)

Set the rich text format configuration of the document.

You need to config it if you use rich text `mark` method. Specifically, you need to config the `expand` property of each style.

Expand is used to specify the behavior of expanding when new text is inserted at the beginning or end of the style.

func (*LoroDoc) DeleteRootContainer

func (_self *LoroDoc) DeleteRootContainer(cid ContainerId)

Delete all content from a root container and hide it from the document.

When a root container is empty and hidden: - It won't show up in `get_deep_value()` results - It won't be included in document snapshots

Only works on root containers (containers without parents).

func (*LoroDoc) Destroy

func (object *LoroDoc) Destroy()

func (*LoroDoc) Detach

func (_self *LoroDoc) Detach()

Force the document enter the detached mode.

In this mode, when you importing new updates, the [loro_internal::DocState] will not be changed.

Learn more at https://loro.dev/docs/advanced/doc_state_and_oplog#attacheddetached-status

func (*LoroDoc) Diff

func (_self *LoroDoc) Diff(a *Frontiers, b *Frontiers) (*DiffBatch, error)

Calculate the diff between two versions

func (*LoroDoc) Export added in v0.3.0

func (_self *LoroDoc) Export(mode ExportMode) ([]byte, error)

Export the document in the given mode.

func (*LoroDoc) ExportJsonInIdSpan

func (_self *LoroDoc) ExportJsonInIdSpan(idSpan IdSpan) []string

Exports changes within the specified ID span to JSON schema format.

The JSON schema format produced by this method is identical to the one generated by `export_json_updates`. It ensures deterministic output, making it ideal for hash calculations and integrity checks.

This method can also export pending changes from the uncommitted transaction that have not yet been applied to the OpLog.

This method will NOT trigger a new commit implicitly.

func (*LoroDoc) ExportJsonUpdates

func (_self *LoroDoc) ExportJsonUpdates(startVv *VersionVector, endVv *VersionVector) string

Export the current state with json-string format of the document.

func (*LoroDoc) ExportJsonUpdatesWithoutPeerCompression

func (_self *LoroDoc) ExportJsonUpdatesWithoutPeerCompression(startVv *VersionVector, endVv *VersionVector) string

Export the current state with json-string format of the document, without peer compression.

Compared to [`export_json_updates`], this method does not compress the peer IDs in the updates. So the operations are easier to be processed by application code.

func (*LoroDoc) ExportShallowSnapshot

func (_self *LoroDoc) ExportShallowSnapshot(frontiers *Frontiers) ([]byte, error)

func (*LoroDoc) ExportSnapshot

func (_self *LoroDoc) ExportSnapshot() ([]byte, error)

Export the current state and history of the document.

func (*LoroDoc) ExportSnapshotAt

func (_self *LoroDoc) ExportSnapshotAt(frontiers *Frontiers) ([]byte, error)

func (*LoroDoc) ExportStateOnly

func (_self *LoroDoc) ExportStateOnly(frontiers **Frontiers) ([]byte, error)

func (*LoroDoc) ExportUpdates

func (_self *LoroDoc) ExportUpdates(vv *VersionVector) ([]byte, error)

Export all the ops not included in the given `VersionVector`

func (*LoroDoc) ExportUpdatesInRange

func (_self *LoroDoc) ExportUpdatesInRange(spans []IdSpan) ([]byte, error)

func (*LoroDoc) FindByPath added in v0.4.0

func (d *LoroDoc) FindByPath(parts ...any) *ValueOrContainer

FindByPath returns the value or container at the given path, or nil if the path does not resolve.

Path parts are converted to Index values: strings become IndexKey, signed and unsigned integer types become IndexSeq, and TreeId becomes IndexNode. Index values are passed through unchanged. Any other type panics.

v := doc.FindByPath("users", 0, "name")

func (*LoroDoc) FindByStrPath added in v0.4.0

func (d *LoroDoc) FindByStrPath(path string) *ValueOrContainer

FindByStrPath returns the value or container at the given string path, or nil if the path does not resolve.

func (*LoroDoc) FindContainer added in v0.4.0

func (d *LoroDoc) FindContainer(id ContainerId) *ValueOrContainer

FindContainer returns the value or container with the given id, or nil if no such container exists.

func (*LoroDoc) FindCounter added in v0.4.0

func (d *LoroDoc) FindCounter(id ContainerIdLike) *LoroCounter

FindCounter returns the counter at id, or nil if no such container exists. Unlike GetCounter, it does not create the container if absent.

func (*LoroDoc) FindIdSpansBetween

func (_self *LoroDoc) FindIdSpansBetween(from *Frontiers, to *Frontiers) VersionVectorDiff

Find the operation id spans that between the `from` version and the `to` version.

func (*LoroDoc) FindList added in v0.4.0

func (d *LoroDoc) FindList(id ContainerIdLike) *LoroList

FindList returns the list at id, or nil if no such container exists. Unlike GetList, it does not create the container if absent.

func (*LoroDoc) FindMap added in v0.4.0

func (d *LoroDoc) FindMap(id ContainerIdLike) *LoroMap

FindMap returns the map at id, or nil if no such container exists. Unlike GetMap, it does not create the container if absent.

func (*LoroDoc) FindMovableList added in v0.4.0

func (d *LoroDoc) FindMovableList(id ContainerIdLike) *LoroMovableList

FindMovableList returns the movable list at id, or nil if no such container exists. Unlike GetMovableList, it does not create the container if absent.

func (*LoroDoc) FindText added in v0.4.0

func (d *LoroDoc) FindText(id ContainerIdLike) *LoroText

FindText returns the text container at id, or nil if no such container exists. Unlike GetText, it does not create the container if absent.

func (*LoroDoc) FindTree added in v0.4.0

func (d *LoroDoc) FindTree(id ContainerIdLike) *LoroTree

FindTree returns the tree at id, or nil if no such container exists. Unlike GetTree, it does not create the container if absent.

func (*LoroDoc) Fork

func (_self *LoroDoc) Fork() *LoroDoc

Duplicate the document with a different PeerID

The time complexity and space complexity of this operation are both O(n),

When called in detached mode, it will fork at the current state frontiers. It will have the same effect as `fork_at(&self.state_frontiers())`.

func (*LoroDoc) ForkAt

func (_self *LoroDoc) ForkAt(frontiers *Frontiers) (*LoroDoc, error)

Fork the document at the given frontiers.

The created doc will only contain the history before the specified frontiers.

func (*LoroDoc) FreeDiffCalculator

func (_self *LoroDoc) FreeDiffCalculator()

Free the cached diff calculator that is used for checkout.

func (*LoroDoc) FreeHistoryCache

func (_self *LoroDoc) FreeHistoryCache()

Free the history cache that is used for making checkout faster.

If you use checkout that switching to an old/concurrent version, the history cache will be built. You can free it by calling this method.

func (*LoroDoc) FrontiersToVv

func (_self *LoroDoc) FrontiersToVv(frontiers *Frontiers) **VersionVector

Convert `Frontiers` into `VersionVector`

func (*LoroDoc) GetByPath

func (_self *LoroDoc) GetByPath(path []Index) **ValueOrContainer

Get the handler by the path.

func (*LoroDoc) GetByStrPath

func (_self *LoroDoc) GetByStrPath(path string) **ValueOrContainer

The path can be specified in different ways depending on the container type:

For Tree: 1. Using node IDs: `tree/{node_id}/property` 2. Using indices: `tree/0/1/property`

For List and MovableList: - Using indices: `list/0` or `list/1/property`

For Map: - Using keys: `map/key` or `map/nested/property`

For tree structures, index-based paths follow depth-first traversal order. The indices start from 0 and represent the position of a node among its siblings.

# Examples ``` # use loro::{LoroDoc, LoroValue}; let doc = LoroDoc::new();

// Tree example let tree = doc.get_tree("tree"); let root = tree.create(None).unwrap(); tree.get_meta(root).unwrap().insert("name", "root").unwrap(); // Access tree by ID or index let name1 = doc.get_by_str_path(&format!("tree/{}/name", root)).unwrap().into_value().unwrap(); let name2 = doc.get_by_str_path("tree/0/name").unwrap().into_value().unwrap(); assert_eq!(name1, name2);

// List example let list = doc.get_list("list"); list.insert(0, "first").unwrap(); list.insert(1, "second").unwrap(); // Access list by index let item = doc.get_by_str_path("list/0"); assert_eq!(item.unwrap().into_value().unwrap().into_string().unwrap(), "first".into());

// Map example let map = doc.get_map("map"); map.insert("key", "value").unwrap(); // Access map by key let value = doc.get_by_str_path("map/key"); assert_eq!(value.unwrap().into_value().unwrap().into_string().unwrap(), "value".into());

// MovableList example let mlist = doc.get_movable_list("mlist"); mlist.insert(0, "item").unwrap(); // Access movable list by index let item = doc.get_by_str_path("mlist/0"); assert_eq!(item.unwrap().into_value().unwrap().into_string().unwrap(), "item".into()); ```

func (*LoroDoc) GetChange

func (_self *LoroDoc) GetChange(id Id) *ChangeMeta

Get `Change` at the given id.

`Change` is a grouped continuous operations that share the same id, timestamp, commit message.

- The id of the `Change` is the id of its first op. - The second op's id is `{ peer: change.id.peer, counter: change.id.counter + 1 }`

The same applies on `Lamport`:

- The lamport of the `Change` is the lamport of its first op. - The second op's lamport is `change.lamport + 1`

The length of the `Change` is how many operations it contains

func (*LoroDoc) GetChangedContainersIn

func (_self *LoroDoc) GetChangedContainersIn(id Id, len uint32) []ContainerId

Gets container IDs modified in the given ID range.

**NOTE:** This method will implicitly commit.

This method can be used in conjunction with `doc.travel_change_ancestors()` to traverse the history and identify all changes that affected specific containers.

Arguments

* `id` - The starting ID of the change range * `len` - The length of the change range to check

func (*LoroDoc) GetContainer added in v0.2.0

func (_self *LoroDoc) GetContainer(id ContainerId) **ValueOrContainer

Get a container by container id.

func (*LoroDoc) GetCounter

func (_self *LoroDoc) GetCounter(id ContainerIdLike) *LoroCounter

Get a LoroCounter by container id.

If the provided id is string, it will be converted into a root container id with the name of the string.

func (*LoroDoc) GetCursorPos

func (_self *LoroDoc) GetCursorPos(cursor *Cursor) (PosQueryResult, error)

func (*LoroDoc) GetDeepValue

func (_self *LoroDoc) GetDeepValue() LoroValue

Get the entire state of the current DocState

func (*LoroDoc) GetDeepValueWithId

func (_self *LoroDoc) GetDeepValueWithId() LoroValue

Get the entire state of the current DocState with container id

func (*LoroDoc) GetList

func (_self *LoroDoc) GetList(id ContainerIdLike) *LoroList

Get a LoroList by container id.

If the provided id is string, it will be converted into a root container id with the name of the string.

func (*LoroDoc) GetMap

func (_self *LoroDoc) GetMap(id ContainerIdLike) *LoroMap

Get a LoroMap by container id.

If the provided id is string, it will be converted into a root container id with the name of the string.

func (*LoroDoc) GetMovableList

func (_self *LoroDoc) GetMovableList(id ContainerIdLike) *LoroMovableList

Get a LoroMovableList by container id.

If the provided id is string, it will be converted into a root container id with the name of the string.

func (*LoroDoc) GetPathToContainer

func (_self *LoroDoc) GetPathToContainer(id ContainerId) *[]ContainerPath

Get the path from the root to the container

func (*LoroDoc) GetPendingTxnLen

func (_self *LoroDoc) GetPendingTxnLen() uint32

Get the number of operations in the pending transaction.

The pending transaction is the one that is not committed yet. It will be committed after calling `doc.commit()`, `doc.export(mode)` or `doc.checkout(version)`.

func (*LoroDoc) GetText

func (_self *LoroDoc) GetText(id ContainerIdLike) *LoroText

Get a LoroText by container id.

If the provided id is string, it will be converted into a root container id with the name of the string.

func (*LoroDoc) GetTree

func (_self *LoroDoc) GetTree(id ContainerIdLike) *LoroTree

Get a LoroTree by container id.

If the provided id is string, it will be converted into a root container id with the name of the string.

func (*LoroDoc) GetValue

func (_self *LoroDoc) GetValue() LoroValue

Get the shallow value of the document.

func (*LoroDoc) HasContainer

func (_self *LoroDoc) HasContainer(id ContainerId) bool

Check if the doc contains the target container.

A root container always exists, while a normal container exists if it has ever been created on the doc.

func (*LoroDoc) HasHistoryCache

func (_self *LoroDoc) HasHistoryCache() bool

func (*LoroDoc) Import

func (_self *LoroDoc) Import(bytes []byte) (ImportStatus, error)

Import updates/snapshot exported by [`LoroDoc::export_snapshot`] or [`LoroDoc::export_from`].

func (*LoroDoc) ImportBatch

func (_self *LoroDoc) ImportBatch(bytes [][]byte) (ImportStatus, error)

Import a batch of updates/snapshot.

The data can be in arbitrary order. The import result will be the same.

func (*LoroDoc) ImportJsonUpdates

func (_self *LoroDoc) ImportJsonUpdates(json string) (ImportStatus, error)

func (*LoroDoc) ImportWith

func (_self *LoroDoc) ImportWith(bytes []byte, origin string) (ImportStatus, error)

Import updates/snapshot exported by [`LoroDoc::export_snapshot`] or [`LoroDoc::export_from`].

It marks the import with a custom `origin` string. It can be used to track the import source in the generated events.

func (*LoroDoc) IsDetached

func (_self *LoroDoc) IsDetached() bool

Whether the document is in detached mode, where the [loro_internal::DocState] is not synchronized with the latest version of the [loro_internal::OpLog].

func (*LoroDoc) IsShallow

func (_self *LoroDoc) IsShallow() bool

Check if the doc contains the full history.

func (*LoroDoc) Jsonpath

func (_self *LoroDoc) Jsonpath(path string) ([]*ValueOrContainer, error)

Evaluate a JSONPath expression on the document and return matching values or handlers.

This method allows querying the document structure using JSONPath syntax. It returns a vector of `ValueOrHandler` which can represent either primitive values or container handlers, depending on what the JSONPath expression matches.

Arguments

* `path` - A string slice containing the JSONPath expression to evaluate.

Returns

A `Result` containing either: - `Ok(Vec<ValueOrHandler>)`: A vector of matching values or handlers. - `Err(String)`: An error message if the JSONPath expression is invalid or evaluation fails.

Example

``` # use loro::LoroDoc; let doc = LoroDoc::new(); let map = doc.get_map("users"); map.insert("alice", 30).unwrap(); map.insert("bob", 25).unwrap();

let result = doc.jsonpath("$.users.alice").unwrap(); assert_eq!(result.len(), 1); assert_eq!(result[0].to_json_value(), serde_json::json!(30)); ```

func (*LoroDoc) LenChanges

func (_self *LoroDoc) LenChanges() uint64

Get the total number of changes in the `OpLog`

func (*LoroDoc) LenOps

func (_self *LoroDoc) LenOps() uint64

Get the total number of operations in the `OpLog`

func (*LoroDoc) MinimizeFrontiers

func (_self *LoroDoc) MinimizeFrontiers(frontiers *Frontiers) FrontiersOrId

Minimize the frontiers by removing the unnecessary entries.

func (*LoroDoc) OplogFrontiers

func (_self *LoroDoc) OplogFrontiers() *Frontiers

Get the `Frontiers` version of `OpLog`

func (*LoroDoc) OplogVv

func (_self *LoroDoc) OplogVv() *VersionVector

Get the `VersionVector` version of `OpLog`

func (*LoroDoc) PeerId

func (_self *LoroDoc) PeerId() uint64

Get the PeerID

func (*LoroDoc) RedactJsonUpdates

func (_self *LoroDoc) RedactJsonUpdates(json string, versionRange *VersionRange) (string, error)

Redacts sensitive content in JSON updates within the specified version range.

This function allows you to share document history while removing potentially sensitive content. It preserves the document structure and collaboration capabilities while replacing content with placeholders according to these redaction rules:

- Preserves delete and move operations - Replaces text insertion content with the Unicode replacement character - Substitutes list and map insert values with null - Maintains structure of child containers - Replaces text mark values with null - Preserves map keys and text annotation keys

func (*LoroDoc) RevertTo

func (_self *LoroDoc) RevertTo(version *Frontiers) error

Revert the current document state back to the target version

Internally, it will generate a series of local operations that can revert the current doc to the target version. It will calculate the diff between the current state and the target state, and apply the diff to the current state.

func (*LoroDoc) SetChangeMergeInterval

func (_self *LoroDoc) SetChangeMergeInterval(interval int64)

Set the interval of mergeable changes, **in seconds**.

If two continuous local changes are within the interval, they will be merged into one change. The default value is 1000 seconds.

By default, we record timestamps in seconds for each change. So if the merge interval is 1, and changes A and B have timestamps of 3 and 4 respectively, then they will be merged into one change

func (*LoroDoc) SetHideEmptyRootContainers

func (_self *LoroDoc) SetHideEmptyRootContainers(hide bool)

Set whether to hide empty root containers.

func (*LoroDoc) SetNextCommitMessage

func (_self *LoroDoc) SetNextCommitMessage(msg string)

Set commit message for the current uncommitted changes

It will be persisted.

func (*LoroDoc) SetNextCommitOptions

func (_self *LoroDoc) SetNextCommitOptions(options CommitOptions)

Set the options of the next commit.

It will be used when the next commit is performed.

func (*LoroDoc) SetNextCommitOrigin

func (_self *LoroDoc) SetNextCommitOrigin(origin string)

Set `origin` for the current uncommitted changes, it can be used to track the source of changes in an event.

It will NOT be persisted.

func (*LoroDoc) SetNextCommitTimestamp

func (_self *LoroDoc) SetNextCommitTimestamp(timestamp int64)

Set the timestamp of the next commit.

It will be persisted and stored in the `OpLog`. You can get the timestamp from the [`Change`] type.

func (*LoroDoc) SetPeerId

func (_self *LoroDoc) SetPeerId(peer uint64) error

Change the PeerID

NOTE: You need to make sure there is no chance two peer have the same PeerID. If it happens, the document will be corrupted.

func (*LoroDoc) SetRecordTimestamp

func (_self *LoroDoc) SetRecordTimestamp(record bool)

Set whether to record the timestamp of each change. Default is `false`.

If enabled, the Unix timestamp will be recorded for each change automatically.

You can set each timestamp manually when committing a change.

NOTE: Timestamps are forced to be in ascending order. If you commit a new change with a timestamp that is less than the existing one, the largest existing timestamp will be used instead.

func (*LoroDoc) ShallowSinceVv

func (_self *LoroDoc) ShallowSinceVv() *VersionVector

Get the `VersionVector` of trimmed history

The ops included by the trimmed history are not in the doc.

func (*LoroDoc) StateFrontiers

func (_self *LoroDoc) StateFrontiers() *Frontiers

Get the `Frontiers` version of `DocState`

Learn more about [`Frontiers`](https://loro.dev/docs/advanced/version_deep_dive)

func (*LoroDoc) StateVv

func (_self *LoroDoc) StateVv() *VersionVector

Get the `VersionVector` version of `DocState`

func (*LoroDoc) Subscribe

func (_self *LoroDoc) Subscribe(containerId ContainerId, subscriber Subscriber) *Subscription

Subscribe the events of a container.

The callback will be invoked when the container is changed. Returns a subscription that can be used to unsubscribe.

The events will be emitted after a transaction is committed. A transaction is committed when:

- `doc.commit()` is called. - `doc.export(mode)` is called. - `doc.import(data)` is called. - `doc.checkout(version)` is called.

func (*LoroDoc) SubscribeFirstCommitFromPeer

func (_self *LoroDoc) SubscribeFirstCommitFromPeer(callback FirstCommitFromPeerCallback) *Subscription

Subscribe to the first commit from a peer. Operations performed on the `LoroDoc` within this callback will be merged into the current commit.

This is useful for managing the relationship between `PeerID` and user information. For example, you could store user names in a `LoroMap` using `PeerID` as the key and the `UserID` as the value.

func (*LoroDoc) SubscribeFirstCommitFromPeerFn added in v0.4.0

func (doc *LoroDoc) SubscribeFirstCommitFromPeerFn(fn func(payload FirstCommitFromPeerPayload)) *Subscription

SubscribeFirstCommitFromPeerFn is a convenience wrapper around LoroDoc.SubscribeFirstCommitFromPeer that accepts a plain function instead of a FirstCommitFromPeerCallback interface.

sub := doc.SubscribeFirstCommitFromPeerFn(func(payload loro.FirstCommitFromPeerPayload) {
	fmt.Println("new peer:", payload.PeerId)
})
defer sub.Unsubscribe()

func (*LoroDoc) SubscribeFn added in v0.4.0

func (doc *LoroDoc) SubscribeFn(containerId ContainerId, fn func(diff DiffEvent)) *Subscription

SubscribeFn is a convenience wrapper around LoroDoc.Subscribe that accepts a plain function instead of a Subscriber interface.

sub := doc.SubscribeFn(containerId, func(diff loro.DiffEvent) {
	fmt.Println("container changed:", diff.TriggeredBy)
})
defer sub.Unsubscribe()

func (*LoroDoc) SubscribeJsonpath added in v0.2.0

func (_self *LoroDoc) SubscribeJsonpath(path string, callback JsonPathSubscriber) (*Subscription, error)

Subscribe to updates that might affect the given JSONPath query.

The callback may fire false positives; it is intended as a lightweight notification so callers can debounce or throttle before re-running JSONPath themselves.

func (*LoroDoc) SubscribeJsonpathFn added in v0.4.0

func (doc *LoroDoc) SubscribeJsonpathFn(path string, fn func()) (*Subscription, error)

SubscribeJsonpathFn is a convenience wrapper around LoroDoc.SubscribeJsonpath that accepts a plain function instead of a JsonPathSubscriber interface.

sub, err := doc.SubscribeJsonpathFn("$.users[*].name", func() {
	results := doc.JsonpathQuery("$.users[*].name")
	fmt.Println("names:", results)
})
if err != nil {
	log.Fatal(err)
}
defer sub.Unsubscribe()

func (*LoroDoc) SubscribeLocalUpdate

func (_self *LoroDoc) SubscribeLocalUpdate(callback LocalUpdateCallback) *Subscription

Subscribe the local update of the document.

func (*LoroDoc) SubscribeLocalUpdateFn added in v0.4.0

func (doc *LoroDoc) SubscribeLocalUpdateFn(fn func(update []byte)) *Subscription

SubscribeLocalUpdateFn is a convenience wrapper around LoroDoc.SubscribeLocalUpdate that accepts a plain function instead of a LocalUpdateCallback interface.

sub := doc.SubscribeLocalUpdateFn(func(update []byte) {
	_ = conn.Send(update)
})
defer sub.Unsubscribe()

func (*LoroDoc) SubscribePreCommit

func (_self *LoroDoc) SubscribePreCommit(callback PreCommitCallback) *Subscription

Subscribe to the pre-commit event.

The callback will be called when the changes are committed but not yet applied to the OpLog. You can modify the commit message and timestamp in the callback by [`ChangeModifier`].

func (*LoroDoc) SubscribePreCommitFn added in v0.4.0

func (doc *LoroDoc) SubscribePreCommitFn(fn func(payload PreCommitCallbackPayload)) *Subscription

SubscribePreCommitFn is a convenience wrapper around LoroDoc.SubscribePreCommit that accepts a plain function instead of a PreCommitCallback interface.

sub := doc.SubscribePreCommitFn(func(payload loro.PreCommitCallbackPayload) {
	payload.Modifier.SetMessage("auto-tagged")
})
defer sub.Unsubscribe()

func (*LoroDoc) SubscribeRoot

func (_self *LoroDoc) SubscribeRoot(subscriber Subscriber) *Subscription

Subscribe all the events.

The callback will be invoked when any part of the [loro_internal::DocState] is changed. Returns a subscription that can be used to unsubscribe.

func (*LoroDoc) SubscribeRootFn added in v0.4.0

func (doc *LoroDoc) SubscribeRootFn(fn func(diff DiffEvent)) *Subscription

SubscribeRootFn is a convenience wrapper around LoroDoc.SubscribeRoot that accepts a plain function instead of a Subscriber interface.

sub := doc.SubscribeRootFn(func(diff loro.DiffEvent) {
	fmt.Println("document changed:", diff.TriggeredBy)
})
defer sub.Unsubscribe()

func (*LoroDoc) TravelChangeAncestors

func (_self *LoroDoc) TravelChangeAncestors(ids []Id, f ChangeAncestorsTraveler) error

Traverses the ancestors of the Change containing the given ID, including itself.

This method visits all ancestors in causal order, from the latest to the oldest, based on their Lamport timestamps.

Arguments

* `ids` - The IDs of the Change to start the traversal from. * `f` - A mutable function that is called for each ancestor. It can return `ControlFlow::Break(())` to stop the traversal.

func (*LoroDoc) TravelChangeAncestorsFn added in v0.4.0

func (doc *LoroDoc) TravelChangeAncestorsFn(ids []Id, fn func(change ChangeMeta) bool) error

TravelChangeAncestorsFn is a convenience wrapper around LoroDoc.TravelChangeAncestors that accepts a plain function instead of a ChangeAncestorsTraveler interface. Return true to continue traversal, or false to stop early.

doc.TravelChangeAncestorsFn(ids, func(change loro.ChangeMeta) bool {
	fmt.Println("peer:", change.Id.Peer)
	return true
})

func (*LoroDoc) TryGetCounter added in v0.4.0

func (_self *LoroDoc) TryGetCounter(id ContainerIdLike) **LoroCounter

Try to get a LoroCounter by container id.

Returns null if the container does not exist.

func (*LoroDoc) TryGetList added in v0.4.0

func (_self *LoroDoc) TryGetList(id ContainerIdLike) **LoroList

Try to get a LoroList by container id.

Returns null if the container does not exist.

func (*LoroDoc) TryGetMap added in v0.4.0

func (_self *LoroDoc) TryGetMap(id ContainerIdLike) **LoroMap

Try to get a LoroMap by container id.

Returns null if the container does not exist.

func (*LoroDoc) TryGetMovableList added in v0.4.0

func (_self *LoroDoc) TryGetMovableList(id ContainerIdLike) **LoroMovableList

Try to get a LoroMovableList by container id.

Returns null if the container does not exist.

func (*LoroDoc) TryGetText added in v0.4.0

func (_self *LoroDoc) TryGetText(id ContainerIdLike) **LoroText

Try to get a LoroText by container id.

Returns null if the container does not exist.

func (*LoroDoc) TryGetTree added in v0.4.0

func (_self *LoroDoc) TryGetTree(id ContainerIdLike) **LoroTree

Try to get a LoroTree by container id.

Returns null if the container does not exist.

func (*LoroDoc) VvToFrontiers

func (_self *LoroDoc) VvToFrontiers(vv *VersionVector) *Frontiers

Convert `VersionVector` into `Frontiers`

type LoroDocInterface

type LoroDocInterface interface {
	// Apply a diff to the current document state.
	//
	// Internally, it will apply the diff to the current state.
	ApplyDiff(diff *DiffBatch) error
	// Attach the document state to the latest known version.
	//
	// > The document becomes detached during a `checkout` operation.
	// > Being `detached` implies that the `DocState` is not synchronized with the latest version of the `OpLog`.
	// > In a detached state, the document is not editable, and any `import` operations will be
	// > recorded in the `OpLog` without being applied to the `DocState`.
	Attach()
	// Check the correctness of the document state by comparing it with the state
	// calculated by applying all the history.
	CheckStateCorrectnessSlow()
	// Checkout the `DocState` to a specific version.
	//
	// The document becomes detached during a `checkout` operation.
	// Being `detached` implies that the `DocState` is not synchronized with the latest version of the `OpLog`.
	// In a detached state, the document is not editable, and any `import` operations will be
	// recorded in the `OpLog` without being applied to the `DocState`.
	//
	// You should call `attach` to attach the `DocState` to the latest version of `OpLog`.
	Checkout(frontiers *Frontiers) error
	// Checkout the `DocState` to the latest version.
	//
	// > The document becomes detached during a `checkout` operation.
	// > Being `detached` implies that the `DocState` is not synchronized with the latest version of the `OpLog`.
	// > In a detached state, the document is not editable, and any `import` operations will be
	// > recorded in the `OpLog` without being applied to the `DocState`.
	//
	// This has the same effect as `attach`.
	CheckoutToLatest()
	// Clear the options of the next commit.
	ClearNextCommitOptions()
	// Compare the frontiers with the current OpLog's version.
	//
	// If `other` contains any version that's not contained in the current OpLog, return [Ordering::Less].
	CmpWithFrontiers(other *Frontiers) Ordering
	// Commit the cumulative auto commit transaction.
	//
	// There is a transaction behind every operation.
	// The events will be emitted after a transaction is committed. A transaction is committed when:
	//
	// - `doc.commit()` is called.
	// - `doc.export(mode)` is called.
	// - `doc.import(data)` is called.
	// - `doc.checkout(version)` is called.
	Commit()
	CommitWith(options CommitOptions)
	// Encoded all ops and history cache to bytes and store them in the kv store.
	//
	// The parsed ops will be dropped
	CompactChangeStore()
	// Get the configurations of the document.
	Config() *Configure
	// Configures the default text style for the document.
	//
	// This method sets the default text style configuration for the document when using LoroText.
	// If `None` is provided, the default style is reset.
	//
	// # Parameters
	//
	// - `text_style`: The style configuration to set as the default. `None` to reset.
	ConfigDefaultTextStyle(textStyle *StyleConfig)
	// Set the rich text format configuration of the document.
	//
	// You need to config it if you use rich text `mark` method.
	// Specifically, you need to config the `expand` property of each style.
	//
	// Expand is used to specify the behavior of expanding when new text is inserted at the
	// beginning or end of the style.
	ConfigTextStyle(textStyle *StyleConfigMap)
	// Delete all content from a root container and hide it from the document.
	//
	// When a root container is empty and hidden:
	// - It won't show up in `get_deep_value()` results
	// - It won't be included in document snapshots
	//
	// Only works on root containers (containers without parents).
	DeleteRootContainer(cid ContainerId)
	// Force the document enter the detached mode.
	//
	// In this mode, when you importing new updates, the [loro_internal::DocState] will not be changed.
	//
	// Learn more at https://loro.dev/docs/advanced/doc_state_and_oplog#attacheddetached-status
	Detach()
	// Calculate the diff between two versions
	Diff(a *Frontiers, b *Frontiers) (*DiffBatch, error)
	// Export the document in the given mode.
	Export(mode ExportMode) ([]byte, error)
	// Exports changes within the specified ID span to JSON schema format.
	//
	// The JSON schema format produced by this method is identical to the one generated by `export_json_updates`.
	// It ensures deterministic output, making it ideal for hash calculations and integrity checks.
	//
	// This method can also export pending changes from the uncommitted transaction that have not yet been applied to the OpLog.
	//
	// This method will NOT trigger a new commit implicitly.
	ExportJsonInIdSpan(idSpan IdSpan) []string
	// Export the current state with json-string format of the document.
	ExportJsonUpdates(startVv *VersionVector, endVv *VersionVector) string
	// Export the current state with json-string format of the document, without peer compression.
	//
	// Compared to [`export_json_updates`], this method does not compress the peer IDs in the updates.
	// So the operations are easier to be processed by application code.
	ExportJsonUpdatesWithoutPeerCompression(startVv *VersionVector, endVv *VersionVector) string
	ExportShallowSnapshot(frontiers *Frontiers) ([]byte, error)
	// Export the current state and history of the document.
	ExportSnapshot() ([]byte, error)
	ExportSnapshotAt(frontiers *Frontiers) ([]byte, error)
	ExportStateOnly(frontiers **Frontiers) ([]byte, error)
	// Export all the ops not included in the given `VersionVector`
	ExportUpdates(vv *VersionVector) ([]byte, error)
	ExportUpdatesInRange(spans []IdSpan) ([]byte, error)
	// Find the operation id spans that between the `from` version and the `to` version.
	FindIdSpansBetween(from *Frontiers, to *Frontiers) VersionVectorDiff
	// Duplicate the document with a different PeerID
	//
	// The time complexity and space complexity of this operation are both O(n),
	//
	// When called in detached mode, it will fork at the current state frontiers.
	// It will have the same effect as `fork_at(&self.state_frontiers())`.
	Fork() *LoroDoc
	// Fork the document at the given frontiers.
	//
	// The created doc will only contain the history before the specified frontiers.
	ForkAt(frontiers *Frontiers) (*LoroDoc, error)
	// Free the cached diff calculator that is used for checkout.
	FreeDiffCalculator()
	// Free the history cache that is used for making checkout faster.
	//
	// If you use checkout that switching to an old/concurrent version, the history cache will be built.
	// You can free it by calling this method.
	FreeHistoryCache()
	// Convert `Frontiers` into `VersionVector`
	FrontiersToVv(frontiers *Frontiers) **VersionVector
	// Get the handler by the path.
	GetByPath(path []Index) **ValueOrContainer
	// The path can be specified in different ways depending on the container type:
	//
	// For Tree:
	// 1. Using node IDs: `tree/{node_id}/property`
	// 2. Using indices: `tree/0/1/property`
	//
	// For List and MovableList:
	// - Using indices: `list/0` or `list/1/property`
	//
	// For Map:
	// - Using keys: `map/key` or `map/nested/property`
	//
	// For tree structures, index-based paths follow depth-first traversal order.
	// The indices start from 0 and represent the position of a node among its siblings.
	//
	// # Examples
	// “`
	// # use loro::{LoroDoc, LoroValue};
	// let doc = LoroDoc::new();
	//
	// // Tree example
	// let tree = doc.get_tree("tree");
	// let root = tree.create(None).unwrap();
	// tree.get_meta(root).unwrap().insert("name", "root").unwrap();
	// // Access tree by ID or index
	// let name1 = doc.get_by_str_path(&format!("tree/{}/name", root)).unwrap().into_value().unwrap();
	// let name2 = doc.get_by_str_path("tree/0/name").unwrap().into_value().unwrap();
	// assert_eq!(name1, name2);
	//
	// // List example
	// let list = doc.get_list("list");
	// list.insert(0, "first").unwrap();
	// list.insert(1, "second").unwrap();
	// // Access list by index
	// let item = doc.get_by_str_path("list/0");
	// assert_eq!(item.unwrap().into_value().unwrap().into_string().unwrap(), "first".into());
	//
	// // Map example
	// let map = doc.get_map("map");
	// map.insert("key", "value").unwrap();
	// // Access map by key
	// let value = doc.get_by_str_path("map/key");
	// assert_eq!(value.unwrap().into_value().unwrap().into_string().unwrap(), "value".into());
	//
	// // MovableList example
	// let mlist = doc.get_movable_list("mlist");
	// mlist.insert(0, "item").unwrap();
	// // Access movable list by index
	// let item = doc.get_by_str_path("mlist/0");
	// assert_eq!(item.unwrap().into_value().unwrap().into_string().unwrap(), "item".into());
	// “`
	GetByStrPath(path string) **ValueOrContainer
	// Get `Change` at the given id.
	//
	// `Change` is a grouped continuous operations that share the same id, timestamp, commit message.
	//
	// - The id of the `Change` is the id of its first op.
	// - The second op's id is `{ peer: change.id.peer, counter: change.id.counter + 1 }`
	//
	// The same applies on `Lamport`:
	//
	// - The lamport of the `Change` is the lamport of its first op.
	// - The second op's lamport is `change.lamport + 1`
	//
	// The length of the `Change` is how many operations it contains
	GetChange(id Id) *ChangeMeta
	// Gets container IDs modified in the given ID range.
	//
	// **NOTE:** This method will implicitly commit.
	//
	// This method can be used in conjunction with `doc.travel_change_ancestors()` to traverse
	// the history and identify all changes that affected specific containers.
	//
	// # Arguments
	//
	// * `id` - The starting ID of the change range
	// * `len` - The length of the change range to check
	GetChangedContainersIn(id Id, len uint32) []ContainerId
	// Get a container by container id.
	GetContainer(id ContainerId) **ValueOrContainer
	// Get a [LoroCounter] by container id.
	//
	// If the provided id is string, it will be converted into a root container id with the name of the string.
	GetCounter(id ContainerIdLike) *LoroCounter
	GetCursorPos(cursor *Cursor) (PosQueryResult, error)
	// Get the entire state of the current DocState
	GetDeepValue() LoroValue
	// Get the entire state of the current DocState with container id
	GetDeepValueWithId() LoroValue
	// Get a [LoroList] by container id.
	//
	// If the provided id is string, it will be converted into a root container id with the name of the string.
	GetList(id ContainerIdLike) *LoroList
	// Get a [LoroMap] by container id.
	//
	// If the provided id is string, it will be converted into a root container id with the name of the string.
	GetMap(id ContainerIdLike) *LoroMap
	// Get a [LoroMovableList] by container id.
	//
	// If the provided id is string, it will be converted into a root container id with the name of the string.
	GetMovableList(id ContainerIdLike) *LoroMovableList
	// Get the path from the root to the container
	GetPathToContainer(id ContainerId) *[]ContainerPath
	// Get the number of operations in the pending transaction.
	//
	// The pending transaction is the one that is not committed yet. It will be committed
	// after calling `doc.commit()`, `doc.export(mode)` or `doc.checkout(version)`.
	GetPendingTxnLen() uint32
	// Get a [LoroText] by container id.
	//
	// If the provided id is string, it will be converted into a root container id with the name of the string.
	GetText(id ContainerIdLike) *LoroText
	// Get a [LoroTree] by container id.
	//
	// If the provided id is string, it will be converted into a root container id with the name of the string.
	GetTree(id ContainerIdLike) *LoroTree
	// Get the shallow value of the document.
	GetValue() LoroValue
	// Check if the doc contains the target container.
	//
	// A root container always exists, while a normal container exists
	// if it has ever been created on the doc.
	HasContainer(id ContainerId) bool
	HasHistoryCache() bool
	// Import updates/snapshot exported by [`LoroDoc::export_snapshot`] or [`LoroDoc::export_from`].
	Import(bytes []byte) (ImportStatus, error)
	// Import a batch of updates/snapshot.
	//
	// The data can be in arbitrary order. The import result will be the same.
	ImportBatch(bytes [][]byte) (ImportStatus, error)
	ImportJsonUpdates(json string) (ImportStatus, error)
	// Import updates/snapshot exported by [`LoroDoc::export_snapshot`] or [`LoroDoc::export_from`].
	//
	// It marks the import with a custom `origin` string. It can be used to track the import source
	// in the generated events.
	ImportWith(bytes []byte, origin string) (ImportStatus, error)
	// Whether the document is in detached mode, where the [loro_internal::DocState] is not
	// synchronized with the latest version of the [loro_internal::OpLog].
	IsDetached() bool
	// Check if the doc contains the full history.
	IsShallow() bool
	// Evaluate a JSONPath expression on the document and return matching values or handlers.
	//
	// This method allows querying the document structure using JSONPath syntax.
	// It returns a vector of `ValueOrHandler` which can represent either primitive values
	// or container handlers, depending on what the JSONPath expression matches.
	//
	// # Arguments
	//
	// * `path` - A string slice containing the JSONPath expression to evaluate.
	//
	// # Returns
	//
	// A `Result` containing either:
	// - `Ok(Vec<ValueOrHandler>)`: A vector of matching values or handlers.
	// - `Err(String)`: An error message if the JSONPath expression is invalid or evaluation fails.
	//
	// # Example
	//
	// “`
	// # use loro::LoroDoc;
	// let doc = LoroDoc::new();
	// let map = doc.get_map("users");
	// map.insert("alice", 30).unwrap();
	// map.insert("bob", 25).unwrap();
	//
	// let result = doc.jsonpath("$.users.alice").unwrap();
	// assert_eq!(result.len(), 1);
	// assert_eq!(result[0].to_json_value(), serde_json::json!(30));
	// “`
	Jsonpath(path string) ([]*ValueOrContainer, error)
	// Get the total number of changes in the `OpLog`
	LenChanges() uint64
	// Get the total number of operations in the `OpLog`
	LenOps() uint64
	// Minimize the frontiers by removing the unnecessary entries.
	MinimizeFrontiers(frontiers *Frontiers) FrontiersOrId
	// Get the `Frontiers` version of `OpLog`
	OplogFrontiers() *Frontiers
	// Get the `VersionVector` version of `OpLog`
	OplogVv() *VersionVector
	// Get the PeerID
	PeerId() uint64
	// Redacts sensitive content in JSON updates within the specified version range.
	//
	// This function allows you to share document history while removing potentially sensitive content.
	// It preserves the document structure and collaboration capabilities while replacing content with
	// placeholders according to these redaction rules:
	//
	// - Preserves delete and move operations
	// - Replaces text insertion content with the Unicode replacement character
	// - Substitutes list and map insert values with null
	// - Maintains structure of child containers
	// - Replaces text mark values with null
	// - Preserves map keys and text annotation keys
	RedactJsonUpdates(json string, versionRange *VersionRange) (string, error)
	// Revert the current document state back to the target version
	//
	// Internally, it will generate a series of local operations that can revert the
	// current doc to the target version. It will calculate the diff between the current
	// state and the target state, and apply the diff to the current state.
	RevertTo(version *Frontiers) error
	// Set the interval of mergeable changes, **in seconds**.
	//
	// If two continuous local changes are within the interval, they will be merged into one change.
	// The default value is 1000 seconds.
	//
	// By default, we record timestamps in seconds for each change. So if the merge interval is 1, and changes A and B
	// have timestamps of 3 and 4 respectively, then they will be merged into one change
	SetChangeMergeInterval(interval int64)
	// Set whether to hide empty root containers.
	SetHideEmptyRootContainers(hide bool)
	// Set commit message for the current uncommitted changes
	//
	// It will be persisted.
	SetNextCommitMessage(msg string)
	// Set the options of the next commit.
	//
	// It will be used when the next commit is performed.
	SetNextCommitOptions(options CommitOptions)
	// Set `origin` for the current uncommitted changes, it can be used to track the source of changes in an event.
	//
	// It will NOT be persisted.
	SetNextCommitOrigin(origin string)
	// Set the timestamp of the next commit.
	//
	// It will be persisted and stored in the `OpLog`.
	// You can get the timestamp from the [`Change`] type.
	SetNextCommitTimestamp(timestamp int64)
	// Change the PeerID
	//
	// NOTE: You need to make sure there is no chance two peer have the same PeerID.
	// If it happens, the document will be corrupted.
	SetPeerId(peer uint64) error
	// Set whether to record the timestamp of each change. Default is `false`.
	//
	// If enabled, the Unix timestamp will be recorded for each change automatically.
	//
	// You can set each timestamp manually when committing a change.
	//
	// NOTE: Timestamps are forced to be in ascending order.
	// If you commit a new change with a timestamp that is less than the existing one,
	// the largest existing timestamp will be used instead.
	SetRecordTimestamp(record bool)
	// Get the `VersionVector` of trimmed history
	//
	// The ops included by the trimmed history are not in the doc.
	ShallowSinceVv() *VersionVector
	// Get the `Frontiers` version of `DocState`
	//
	// Learn more about [`Frontiers`](https://loro.dev/docs/advanced/version_deep_dive)
	StateFrontiers() *Frontiers
	// Get the `VersionVector` version of `DocState`
	StateVv() *VersionVector
	// Subscribe the events of a container.
	//
	// The callback will be invoked when the container is changed.
	// Returns a subscription that can be used to unsubscribe.
	//
	// The events will be emitted after a transaction is committed. A transaction is committed when:
	//
	// - `doc.commit()` is called.
	// - `doc.export(mode)` is called.
	// - `doc.import(data)` is called.
	// - `doc.checkout(version)` is called.
	Subscribe(containerId ContainerId, subscriber Subscriber) *Subscription
	// Subscribe to the first commit from a peer. Operations performed on the `LoroDoc` within this callback
	// will be merged into the current commit.
	//
	// This is useful for managing the relationship between `PeerID` and user information.
	// For example, you could store user names in a `LoroMap` using `PeerID` as the key and the `UserID` as the value.
	SubscribeFirstCommitFromPeer(callback FirstCommitFromPeerCallback) *Subscription
	// Subscribe to updates that might affect the given JSONPath query.
	//
	// The callback may fire false positives; it is intended as a lightweight notification so
	// callers can debounce or throttle before re-running JSONPath themselves.
	SubscribeJsonpath(path string, callback JsonPathSubscriber) (*Subscription, error)
	// Subscribe the local update of the document.
	SubscribeLocalUpdate(callback LocalUpdateCallback) *Subscription
	// Subscribe to the pre-commit event.
	//
	// The callback will be called when the changes are committed but not yet applied to the OpLog.
	// You can modify the commit message and timestamp in the callback by [`ChangeModifier`].
	SubscribePreCommit(callback PreCommitCallback) *Subscription
	// Subscribe all the events.
	//
	// The callback will be invoked when any part of the [loro_internal::DocState] is changed.
	// Returns a subscription that can be used to unsubscribe.
	SubscribeRoot(subscriber Subscriber) *Subscription
	// Traverses the ancestors of the Change containing the given ID, including itself.
	//
	// This method visits all ancestors in causal order, from the latest to the oldest,
	// based on their Lamport timestamps.
	//
	// # Arguments
	//
	// * `ids` - The IDs of the Change to start the traversal from.
	// * `f` - A mutable function that is called for each ancestor. It can return `ControlFlow::Break(())` to stop the traversal.
	TravelChangeAncestors(ids []Id, f ChangeAncestorsTraveler) error
	// Try to get a [LoroCounter] by container id.
	//
	// Returns null if the container does not exist.
	TryGetCounter(id ContainerIdLike) **LoroCounter
	// Try to get a [LoroList] by container id.
	//
	// Returns null if the container does not exist.
	TryGetList(id ContainerIdLike) **LoroList
	// Try to get a [LoroMap] by container id.
	//
	// Returns null if the container does not exist.
	TryGetMap(id ContainerIdLike) **LoroMap
	// Try to get a [LoroMovableList] by container id.
	//
	// Returns null if the container does not exist.
	TryGetMovableList(id ContainerIdLike) **LoroMovableList
	// Try to get a [LoroText] by container id.
	//
	// Returns null if the container does not exist.
	TryGetText(id ContainerIdLike) **LoroText
	// Try to get a [LoroTree] by container id.
	//
	// Returns null if the container does not exist.
	TryGetTree(id ContainerIdLike) **LoroTree
	// Convert `VersionVector` into `Frontiers`
	VvToFrontiers(vv *VersionVector) *Frontiers
}

`LoroDoc` is the entry for the whole document. When it's dropped, all the associated [`Handler`]s will be invalidated.

**Important:** Loro is a pure library and does not handle network protocols. It is the responsibility of the user to manage the storage, loading, and synchronization of the bytes exported by Loro in a manner suitable for their specific environment.

type LoroEncodeError

type LoroEncodeError struct {
	// contains filtered or unexported fields
}

func NewLoroEncodeErrorFrontiersNotFound

func NewLoroEncodeErrorFrontiersNotFound() *LoroEncodeError

func NewLoroEncodeErrorShallowSnapshotIncompatibleWithOldFormat

func NewLoroEncodeErrorShallowSnapshotIncompatibleWithOldFormat() *LoroEncodeError

func NewLoroEncodeErrorUnknownContainer

func NewLoroEncodeErrorUnknownContainer() *LoroEncodeError

func (*LoroEncodeError) AsError

func (err *LoroEncodeError) AsError() error

Convenience method to turn *LoroEncodeError into error Avoiding treating nil pointer as non nil error interface

func (LoroEncodeError) Error

func (err LoroEncodeError) Error() string

func (LoroEncodeError) Unwrap

func (err LoroEncodeError) Unwrap() error

type LoroEncodeErrorFrontiersNotFound

type LoroEncodeErrorFrontiersNotFound struct {
	// contains filtered or unexported fields
}

Variant structs

func (LoroEncodeErrorFrontiersNotFound) Error

func (LoroEncodeErrorFrontiersNotFound) Is

type LoroEncodeErrorShallowSnapshotIncompatibleWithOldFormat

type LoroEncodeErrorShallowSnapshotIncompatibleWithOldFormat struct {
	// contains filtered or unexported fields
}

func (LoroEncodeErrorShallowSnapshotIncompatibleWithOldFormat) Error

func (LoroEncodeErrorShallowSnapshotIncompatibleWithOldFormat) Is

type LoroEncodeErrorUnknownContainer

type LoroEncodeErrorUnknownContainer struct {
	// contains filtered or unexported fields
}

func (LoroEncodeErrorUnknownContainer) Error

func (LoroEncodeErrorUnknownContainer) Is

func (self LoroEncodeErrorUnknownContainer) Is(target error) bool

type LoroError

type LoroError struct {
	// contains filtered or unexported fields
}

func NewLoroErrorArgErr

func NewLoroErrorArgErr() *LoroError

func NewLoroErrorAutoCommitNotStarted

func NewLoroErrorAutoCommitNotStarted() *LoroError

func NewLoroErrorConcurrentOpsWithSamePeerId

func NewLoroErrorConcurrentOpsWithSamePeerId() *LoroError

func NewLoroErrorContainerDeleted

func NewLoroErrorContainerDeleted() *LoroError

func NewLoroErrorContainersNotFound

func NewLoroErrorContainersNotFound() *LoroError

func NewLoroErrorDecodeChecksumMismatchError

func NewLoroErrorDecodeChecksumMismatchError() *LoroError

func NewLoroErrorDecodeDataCorruptionError

func NewLoroErrorDecodeDataCorruptionError() *LoroError

func NewLoroErrorDecodeError

func NewLoroErrorDecodeError() *LoroError

func NewLoroErrorDecodeVersionVectorError

func NewLoroErrorDecodeVersionVectorError() *LoroError

func NewLoroErrorDuplicatedTransactionError

func NewLoroErrorDuplicatedTransactionError() *LoroError

func NewLoroErrorEditWhenDetached

func NewLoroErrorEditWhenDetached() *LoroError

func NewLoroErrorEndIndexLessThanStartIndex

func NewLoroErrorEndIndexLessThanStartIndex() *LoroError

func NewLoroErrorFrontiersNotFound

func NewLoroErrorFrontiersNotFound() *LoroError

func NewLoroErrorImportUnsupportedEncodingMode added in v0.2.0

func NewLoroErrorImportUnsupportedEncodingMode() *LoroError

func NewLoroErrorImportUpdatesThatDependsOnOutdatedVersion

func NewLoroErrorImportUpdatesThatDependsOnOutdatedVersion() *LoroError

func NewLoroErrorImportWhenInTxn

func NewLoroErrorImportWhenInTxn() *LoroError

func NewLoroErrorIncompatibleFutureEncodingError

func NewLoroErrorIncompatibleFutureEncodingError() *LoroError

func NewLoroErrorInvalidJsonSchema

func NewLoroErrorInvalidJsonSchema() *LoroError

func NewLoroErrorInvalidPeerId

func NewLoroErrorInvalidPeerId() *LoroError

func NewLoroErrorInvalidRootContainerName

func NewLoroErrorInvalidRootContainerName() *LoroError

func NewLoroErrorJsError

func NewLoroErrorJsError() *LoroError

func NewLoroErrorLockError

func NewLoroErrorLockError() *LoroError

func NewLoroErrorMisuseDetachedContainer

func NewLoroErrorMisuseDetachedContainer() *LoroError

func NewLoroErrorNotFoundError

func NewLoroErrorNotFoundError() *LoroError

func NewLoroErrorNotImplemented

func NewLoroErrorNotImplemented() *LoroError

func NewLoroErrorOutOfBound

func NewLoroErrorOutOfBound() *LoroError

func NewLoroErrorReattachAttachedContainer

func NewLoroErrorReattachAttachedContainer() *LoroError

func NewLoroErrorStyleConfigMissing

func NewLoroErrorStyleConfigMissing() *LoroError

func NewLoroErrorSwitchToVersionBeforeShallowRoot

func NewLoroErrorSwitchToVersionBeforeShallowRoot() *LoroError

func NewLoroErrorTransactionError

func NewLoroErrorTransactionError() *LoroError

func NewLoroErrorTreeError

func NewLoroErrorTreeError() *LoroError

func NewLoroErrorUndoGroupAlreadyStarted

func NewLoroErrorUndoGroupAlreadyStarted() *LoroError

func NewLoroErrorUndoInvalidIdSpan

func NewLoroErrorUndoInvalidIdSpan() *LoroError

func NewLoroErrorUndoWithDifferentPeerId

func NewLoroErrorUndoWithDifferentPeerId() *LoroError

func NewLoroErrorUnknown

func NewLoroErrorUnknown() *LoroError

func NewLoroErrorUnmatchedContext

func NewLoroErrorUnmatchedContext() *LoroError

func NewLoroErrorUsedOpId

func NewLoroErrorUsedOpId() *LoroError

func NewLoroErrorUtf8InUnicodeCodePoint

func NewLoroErrorUtf8InUnicodeCodePoint() *LoroError

func NewLoroErrorUtf16InUnicodeCodePoint

func NewLoroErrorUtf16InUnicodeCodePoint() *LoroError

func (*LoroError) AsError

func (err *LoroError) AsError() error

Convenience method to turn *LoroError into error Avoiding treating nil pointer as non nil error interface

func (LoroError) Error

func (err LoroError) Error() string

func (LoroError) Unwrap

func (err LoroError) Unwrap() error

type LoroErrorArgErr

type LoroErrorArgErr struct {
	// contains filtered or unexported fields
}

func (LoroErrorArgErr) Error

func (err LoroErrorArgErr) Error() string

func (LoroErrorArgErr) Is

func (self LoroErrorArgErr) Is(target error) bool

type LoroErrorAutoCommitNotStarted

type LoroErrorAutoCommitNotStarted struct {
	// contains filtered or unexported fields
}

func (LoroErrorAutoCommitNotStarted) Error

func (LoroErrorAutoCommitNotStarted) Is

func (self LoroErrorAutoCommitNotStarted) Is(target error) bool

type LoroErrorConcurrentOpsWithSamePeerId

type LoroErrorConcurrentOpsWithSamePeerId struct {
	// contains filtered or unexported fields
}

func (LoroErrorConcurrentOpsWithSamePeerId) Error

func (LoroErrorConcurrentOpsWithSamePeerId) Is

type LoroErrorContainerDeleted

type LoroErrorContainerDeleted struct {
	// contains filtered or unexported fields
}

func (LoroErrorContainerDeleted) Error

func (err LoroErrorContainerDeleted) Error() string

func (LoroErrorContainerDeleted) Is

func (self LoroErrorContainerDeleted) Is(target error) bool

type LoroErrorContainersNotFound

type LoroErrorContainersNotFound struct {
	// contains filtered or unexported fields
}

func (LoroErrorContainersNotFound) Error

func (err LoroErrorContainersNotFound) Error() string

func (LoroErrorContainersNotFound) Is

func (self LoroErrorContainersNotFound) Is(target error) bool

type LoroErrorDecodeChecksumMismatchError

type LoroErrorDecodeChecksumMismatchError struct {
	// contains filtered or unexported fields
}

func (LoroErrorDecodeChecksumMismatchError) Error

func (LoroErrorDecodeChecksumMismatchError) Is

type LoroErrorDecodeDataCorruptionError

type LoroErrorDecodeDataCorruptionError struct {
	// contains filtered or unexported fields
}

func (LoroErrorDecodeDataCorruptionError) Error

func (LoroErrorDecodeDataCorruptionError) Is

type LoroErrorDecodeError

type LoroErrorDecodeError struct {
	// contains filtered or unexported fields
}

func (LoroErrorDecodeError) Error

func (err LoroErrorDecodeError) Error() string

func (LoroErrorDecodeError) Is

func (self LoroErrorDecodeError) Is(target error) bool

type LoroErrorDecodeVersionVectorError

type LoroErrorDecodeVersionVectorError struct {
	// contains filtered or unexported fields
}

func (LoroErrorDecodeVersionVectorError) Error

func (LoroErrorDecodeVersionVectorError) Is

type LoroErrorDuplicatedTransactionError

type LoroErrorDuplicatedTransactionError struct {
	// contains filtered or unexported fields
}

func (LoroErrorDuplicatedTransactionError) Error

func (LoroErrorDuplicatedTransactionError) Is

type LoroErrorEditWhenDetached

type LoroErrorEditWhenDetached struct {
	// contains filtered or unexported fields
}

func (LoroErrorEditWhenDetached) Error

func (err LoroErrorEditWhenDetached) Error() string

func (LoroErrorEditWhenDetached) Is

func (self LoroErrorEditWhenDetached) Is(target error) bool

type LoroErrorEndIndexLessThanStartIndex

type LoroErrorEndIndexLessThanStartIndex struct {
	// contains filtered or unexported fields
}

func (LoroErrorEndIndexLessThanStartIndex) Error

func (LoroErrorEndIndexLessThanStartIndex) Is

type LoroErrorFrontiersNotFound

type LoroErrorFrontiersNotFound struct {
	// contains filtered or unexported fields
}

func (LoroErrorFrontiersNotFound) Error

func (err LoroErrorFrontiersNotFound) Error() string

func (LoroErrorFrontiersNotFound) Is

func (self LoroErrorFrontiersNotFound) Is(target error) bool

type LoroErrorImportUnsupportedEncodingMode added in v0.2.0

type LoroErrorImportUnsupportedEncodingMode struct {
	// contains filtered or unexported fields
}

func (LoroErrorImportUnsupportedEncodingMode) Error added in v0.2.0

func (LoroErrorImportUnsupportedEncodingMode) Is added in v0.2.0

type LoroErrorImportUpdatesThatDependsOnOutdatedVersion

type LoroErrorImportUpdatesThatDependsOnOutdatedVersion struct {
	// contains filtered or unexported fields
}

func (LoroErrorImportUpdatesThatDependsOnOutdatedVersion) Error

func (LoroErrorImportUpdatesThatDependsOnOutdatedVersion) Is

type LoroErrorImportWhenInTxn

type LoroErrorImportWhenInTxn struct {
	// contains filtered or unexported fields
}

func (LoroErrorImportWhenInTxn) Error

func (err LoroErrorImportWhenInTxn) Error() string

func (LoroErrorImportWhenInTxn) Is

func (self LoroErrorImportWhenInTxn) Is(target error) bool

type LoroErrorIncompatibleFutureEncodingError

type LoroErrorIncompatibleFutureEncodingError struct {
	// contains filtered or unexported fields
}

func (LoroErrorIncompatibleFutureEncodingError) Error

func (LoroErrorIncompatibleFutureEncodingError) Is

type LoroErrorInvalidJsonSchema

type LoroErrorInvalidJsonSchema struct {
	// contains filtered or unexported fields
}

func (LoroErrorInvalidJsonSchema) Error

func (err LoroErrorInvalidJsonSchema) Error() string

func (LoroErrorInvalidJsonSchema) Is

func (self LoroErrorInvalidJsonSchema) Is(target error) bool

type LoroErrorInvalidPeerId

type LoroErrorInvalidPeerId struct {
	// contains filtered or unexported fields
}

func (LoroErrorInvalidPeerId) Error

func (err LoroErrorInvalidPeerId) Error() string

func (LoroErrorInvalidPeerId) Is

func (self LoroErrorInvalidPeerId) Is(target error) bool

type LoroErrorInvalidRootContainerName

type LoroErrorInvalidRootContainerName struct {
	// contains filtered or unexported fields
}

func (LoroErrorInvalidRootContainerName) Error

func (LoroErrorInvalidRootContainerName) Is

type LoroErrorJsError

type LoroErrorJsError struct {
	// contains filtered or unexported fields
}

func (LoroErrorJsError) Error

func (err LoroErrorJsError) Error() string

func (LoroErrorJsError) Is

func (self LoroErrorJsError) Is(target error) bool

type LoroErrorLockError

type LoroErrorLockError struct {
	// contains filtered or unexported fields
}

func (LoroErrorLockError) Error

func (err LoroErrorLockError) Error() string

func (LoroErrorLockError) Is

func (self LoroErrorLockError) Is(target error) bool

type LoroErrorMisuseDetachedContainer

type LoroErrorMisuseDetachedContainer struct {
	// contains filtered or unexported fields
}

func (LoroErrorMisuseDetachedContainer) Error

func (LoroErrorMisuseDetachedContainer) Is

type LoroErrorNotFoundError

type LoroErrorNotFoundError struct {
	// contains filtered or unexported fields
}

func (LoroErrorNotFoundError) Error

func (err LoroErrorNotFoundError) Error() string

func (LoroErrorNotFoundError) Is

func (self LoroErrorNotFoundError) Is(target error) bool

type LoroErrorNotImplemented

type LoroErrorNotImplemented struct {
	// contains filtered or unexported fields
}

func (LoroErrorNotImplemented) Error

func (err LoroErrorNotImplemented) Error() string

func (LoroErrorNotImplemented) Is

func (self LoroErrorNotImplemented) Is(target error) bool

type LoroErrorOutOfBound

type LoroErrorOutOfBound struct {
	// contains filtered or unexported fields
}

func (LoroErrorOutOfBound) Error

func (err LoroErrorOutOfBound) Error() string

func (LoroErrorOutOfBound) Is

func (self LoroErrorOutOfBound) Is(target error) bool

type LoroErrorReattachAttachedContainer

type LoroErrorReattachAttachedContainer struct {
	// contains filtered or unexported fields
}

func (LoroErrorReattachAttachedContainer) Error

func (LoroErrorReattachAttachedContainer) Is

type LoroErrorStyleConfigMissing

type LoroErrorStyleConfigMissing struct {
	// contains filtered or unexported fields
}

func (LoroErrorStyleConfigMissing) Error

func (err LoroErrorStyleConfigMissing) Error() string

func (LoroErrorStyleConfigMissing) Is

func (self LoroErrorStyleConfigMissing) Is(target error) bool

type LoroErrorSwitchToVersionBeforeShallowRoot

type LoroErrorSwitchToVersionBeforeShallowRoot struct {
	// contains filtered or unexported fields
}

func (LoroErrorSwitchToVersionBeforeShallowRoot) Error

func (LoroErrorSwitchToVersionBeforeShallowRoot) Is

type LoroErrorTransactionError

type LoroErrorTransactionError struct {
	// contains filtered or unexported fields
}

func (LoroErrorTransactionError) Error

func (err LoroErrorTransactionError) Error() string

func (LoroErrorTransactionError) Is

func (self LoroErrorTransactionError) Is(target error) bool

type LoroErrorTreeError

type LoroErrorTreeError struct {
	// contains filtered or unexported fields
}

func (LoroErrorTreeError) Error

func (err LoroErrorTreeError) Error() string

func (LoroErrorTreeError) Is

func (self LoroErrorTreeError) Is(target error) bool

type LoroErrorUndoGroupAlreadyStarted

type LoroErrorUndoGroupAlreadyStarted struct {
	// contains filtered or unexported fields
}

func (LoroErrorUndoGroupAlreadyStarted) Error

func (LoroErrorUndoGroupAlreadyStarted) Is

type LoroErrorUndoInvalidIdSpan

type LoroErrorUndoInvalidIdSpan struct {
	// contains filtered or unexported fields
}

func (LoroErrorUndoInvalidIdSpan) Error

func (err LoroErrorUndoInvalidIdSpan) Error() string

func (LoroErrorUndoInvalidIdSpan) Is

func (self LoroErrorUndoInvalidIdSpan) Is(target error) bool

type LoroErrorUndoWithDifferentPeerId

type LoroErrorUndoWithDifferentPeerId struct {
	// contains filtered or unexported fields
}

func (LoroErrorUndoWithDifferentPeerId) Error

func (LoroErrorUndoWithDifferentPeerId) Is

type LoroErrorUnknown

type LoroErrorUnknown struct {
	// contains filtered or unexported fields
}

func (LoroErrorUnknown) Error

func (err LoroErrorUnknown) Error() string

func (LoroErrorUnknown) Is

func (self LoroErrorUnknown) Is(target error) bool

type LoroErrorUnmatchedContext

type LoroErrorUnmatchedContext struct {
	// contains filtered or unexported fields
}

Variant structs

func (LoroErrorUnmatchedContext) Error

func (err LoroErrorUnmatchedContext) Error() string

func (LoroErrorUnmatchedContext) Is

func (self LoroErrorUnmatchedContext) Is(target error) bool

type LoroErrorUsedOpId

type LoroErrorUsedOpId struct {
	// contains filtered or unexported fields
}

func (LoroErrorUsedOpId) Error

func (err LoroErrorUsedOpId) Error() string

func (LoroErrorUsedOpId) Is

func (self LoroErrorUsedOpId) Is(target error) bool

type LoroErrorUtf8InUnicodeCodePoint

type LoroErrorUtf8InUnicodeCodePoint struct {
	// contains filtered or unexported fields
}

func (LoroErrorUtf8InUnicodeCodePoint) Error

func (LoroErrorUtf8InUnicodeCodePoint) Is

func (self LoroErrorUtf8InUnicodeCodePoint) Is(target error) bool

type LoroErrorUtf16InUnicodeCodePoint

type LoroErrorUtf16InUnicodeCodePoint struct {
	// contains filtered or unexported fields
}

func (LoroErrorUtf16InUnicodeCodePoint) Error

func (LoroErrorUtf16InUnicodeCodePoint) Is

type LoroList

type LoroList struct {
	// contains filtered or unexported fields
}

func GetLoroListContainer

func GetLoroListContainer(v **ValueOrContainer) (*LoroList, bool)

GetLoroListContainer takes a pointer to a ValueOrContainer and returns the LoroList value if it is a LoroList.

func LiftFromExternalLoroList added in v0.3.0

func LiftFromExternalLoroList(handle uint64) *LoroList

func NewLoroList

func NewLoroList() *LoroList

Create a new container that is detached from the document.

The edits on a detached container will not be persisted. To attach the container to the document, please insert it into an attached container.

func (*LoroList) All added in v0.4.0

func (l *LoroList) All() iter.Seq2[int, *ValueOrContainer]

All yields each (index, element) pair in order. The element is a *ValueOrContainer so nested containers are reachable without a second lookup. Len is sampled once at the start.

for i, v := range list.All() {
	// use v
}

func (*LoroList) At added in v0.4.0

func (l *LoroList) At(index uint32) *ValueOrContainer

At returns the value at index, or nil if the index is out of bounds.

func (*LoroList) Attached added in v0.4.0

func (l *LoroList) Attached() *LoroList

Attached returns the live attached version of this container, or nil if the container has been detached and has no attached counterpart.

func (*LoroList) Clear

func (_self *LoroList) Clear() error

Delete all elements in the list.

func (*LoroList) Cursor added in v0.4.0

func (l *LoroList) Cursor(pos uint32, side Side) *Cursor

Cursor creates a stable cursor at pos with the given side, or nil if a cursor cannot be created at that position.

func (*LoroList) Delete

func (_self *LoroList) Delete(pos uint32, len uint32) error

Delete values at the given position.

func (*LoroList) Destroy

func (object *LoroList) Destroy()

func (*LoroList) Doc

func (_self *LoroList) Doc() **LoroDoc

Get the LoroDoc from this container

func (*LoroList) Get

func (_self *LoroList) Get(index uint32) **ValueOrContainer

Get the value at the given position.

func (*LoroList) GetAny added in v0.4.0

func (l *LoroList) GetAny(index uint32) (any, bool)

GetAny returns the value at index as an any, or (nil, false) if the index is out of bounds. Nested containers are returned as their *LoroX wrapper.

func (*LoroList) GetAttached

func (_self *LoroList) GetAttached() **LoroList

If a detached container is attached, this method will return its corresponding attached handler.

func (*LoroList) GetBool added in v0.4.0

func (l *LoroList) GetBool(index uint32) (bool, bool)

GetBool returns the bool value at index, or (false, false) if the index is out of bounds or the value is not a bool.

func (*LoroList) GetCursor

func (_self *LoroList) GetCursor(pos uint32, side Side) **Cursor

func (*LoroList) GetDeepValue

func (_self *LoroList) GetDeepValue() LoroValue

Get the deep value of the container.

func (*LoroList) GetFloat64 added in v0.4.0

func (l *LoroList) GetFloat64(index uint32) (float64, bool)

GetFloat64 returns the float64 value at index, or (0, false) if the index is out of bounds or the value is not a float64.

func (*LoroList) GetIdAt

func (_self *LoroList) GetIdAt(pos uint32) *Id

Get the ID of the list item at the given position.

func (*LoroList) GetInt64 added in v0.4.0

func (l *LoroList) GetInt64(index uint32) (int64, bool)

GetInt64 returns the int64 value at index, or (0, false) if the index is out of bounds or the value is not an int64.

func (*LoroList) GetList added in v0.4.0

func (l *LoroList) GetList(index uint32) ([]LoroValue, bool)

GetList returns the list value at index as []LoroValue, or (nil, false) if the index is out of bounds or the value is not a list.

func (*LoroList) GetListOfAny added in v0.4.0

func (l *LoroList) GetListOfAny(index uint32) ([]any, bool)

GetListOfAny returns the list value at index as []any, or (nil, false) if the index is out of bounds or the value is not a list.

func (*LoroList) GetLoroCounter added in v0.4.0

func (l *LoroList) GetLoroCounter(index uint32) (*LoroCounter, bool)

GetLoroCounter returns the LoroCounter at index, or (nil, false) if the index is out of bounds or the value is not a counter container.

func (*LoroList) GetLoroList added in v0.4.0

func (l *LoroList) GetLoroList(index uint32) (*LoroList, bool)

GetLoroList returns the LoroList at index, or (nil, false) if the index is out of bounds or the value is not a list container.

func (*LoroList) GetLoroMap added in v0.4.0

func (l *LoroList) GetLoroMap(index uint32) (*LoroMap, bool)

GetLoroMap returns the LoroMap at index, or (nil, false) if the index is out of bounds or the value is not a map container.

func (*LoroList) GetLoroMovableList added in v0.4.0

func (l *LoroList) GetLoroMovableList(index uint32) (*LoroMovableList, bool)

GetLoroMovableList returns the LoroMovableList at index, or (nil, false) if the index is out of bounds or the value is not a movable list container.

func (*LoroList) GetLoroText added in v0.4.0

func (l *LoroList) GetLoroText(index uint32) (*LoroText, bool)

GetLoroText returns the LoroText at index, or (nil, false) if the index is out of bounds or the value is not a text container.

func (*LoroList) GetLoroTree added in v0.4.0

func (l *LoroList) GetLoroTree(index uint32) (*LoroTree, bool)

GetLoroTree returns the LoroTree at index, or (nil, false) if the index is out of bounds or the value is not a tree container.

func (*LoroList) GetMap added in v0.4.0

func (l *LoroList) GetMap(index uint32) (map[string]LoroValue, bool)

GetMap returns the map value at index as map[string]LoroValue, or (nil, false) if the index is out of bounds or the value is not a map.

func (*LoroList) GetMapOfAny added in v0.4.0

func (l *LoroList) GetMapOfAny(index uint32) (map[string]any, bool)

GetMapOfAny returns the map value at index as map[string]any, or (nil, false) if the index is out of bounds or the value is not a map.

func (*LoroList) GetString added in v0.4.0

func (l *LoroList) GetString(index uint32) (string, bool)

GetString returns the string value at index, or ("", false) if the index is out of bounds or the value is not a string.

func (*LoroList) GetValue

func (_self *LoroList) GetValue() LoroValue

Get the shallow value of the container.

This does not convert the state of sub-containers; instead, it represents them as [LoroValue::Container].

func (*LoroList) Id

func (_self *LoroList) Id() ContainerId

Get the ID of the container.

func (*LoroList) Insert

func (_self *LoroList) Insert(pos uint32, v LoroValueLike) error

Insert a value at the given position.

func (*LoroList) InsertAny added in v0.4.0

func (l *LoroList) InsertAny(pos uint32, v any) error

InsertAny inserts a plain Go value at pos. The value is converted via AsValue; passing an unsupported type returns an error without modifying the list.

func (*LoroList) InsertCounterContainer

func (_self *LoroList) InsertCounterContainer(pos uint32, child *LoroCounter) (*LoroCounter, error)

func (*LoroList) InsertListContainer

func (_self *LoroList) InsertListContainer(pos uint32, child *LoroList) (*LoroList, error)

func (*LoroList) InsertLoroCounter added in v0.4.0

func (l *LoroList) InsertLoroCounter(pos uint32) (*LoroCounter, error)

InsertLoroCounter inserts a fresh attached LoroCounter at pos and returns it.

func (*LoroList) InsertLoroList added in v0.4.0

func (l *LoroList) InsertLoroList(pos uint32) (*LoroList, error)

InsertLoroList inserts a fresh attached LoroList at pos and returns it.

func (*LoroList) InsertLoroMap added in v0.4.0

func (l *LoroList) InsertLoroMap(pos uint32) (*LoroMap, error)

InsertLoroMap inserts a fresh attached LoroMap at pos and returns it.

func (*LoroList) InsertLoroMovableList added in v0.4.0

func (l *LoroList) InsertLoroMovableList(pos uint32) (*LoroMovableList, error)

InsertLoroMovableList inserts a fresh attached LoroMovableList at pos and returns it.

func (*LoroList) InsertLoroText added in v0.4.0

func (l *LoroList) InsertLoroText(pos uint32) (*LoroText, error)

InsertLoroText inserts a fresh attached LoroText at pos and returns it.

func (*LoroList) InsertLoroTree added in v0.4.0

func (l *LoroList) InsertLoroTree(pos uint32) (*LoroTree, error)

InsertLoroTree inserts a fresh attached LoroTree at pos and returns it.

func (*LoroList) InsertMapContainer

func (_self *LoroList) InsertMapContainer(pos uint32, child *LoroMap) (*LoroMap, error)

func (*LoroList) InsertMovableListContainer

func (_self *LoroList) InsertMovableListContainer(pos uint32, child *LoroMovableList) (*LoroMovableList, error)

func (*LoroList) InsertTextContainer

func (_self *LoroList) InsertTextContainer(pos uint32, child *LoroText) (*LoroText, error)

func (*LoroList) InsertTreeContainer

func (_self *LoroList) InsertTreeContainer(pos uint32, child *LoroTree) (*LoroTree, error)

func (*LoroList) IsAttached

func (_self *LoroList) IsAttached() bool

Whether the container is attached to a document

The edits on a detached container will not be persisted. To attach the container to the document, please insert it into an attached container.

func (*LoroList) IsDeleted

func (_self *LoroList) IsDeleted() bool

Whether the container is deleted.

func (*LoroList) IsEmpty

func (_self *LoroList) IsEmpty() bool

func (*LoroList) IsExplicitlyNil added in v0.4.0

func (l *LoroList) IsExplicitlyNil(index uint32) bool

IsExplicitlyNil reports whether the value at index is set to an explicit nil (LoroValueNull), as opposed to the index being out of bounds.

func (*LoroList) Len

func (_self *LoroList) Len() uint32

func (*LoroList) OwnerDoc added in v0.4.0

func (l *LoroList) OwnerDoc() *LoroDoc

OwnerDoc returns the LoroDoc this container is attached to, or nil if it is detached.

func (*LoroList) Pop

func (_self *LoroList) Pop() (*LoroValue, error)

Pop the last element of the list.

func (*LoroList) Push

func (_self *LoroList) Push(v LoroValueLike) error

func (*LoroList) PushAny added in v0.4.0

func (l *LoroList) PushAny(v any) error

PushAny appends a plain Go value. The value is converted via AsValue; passing an unsupported type returns an error without modifying the list.

func (*LoroList) Subscribe

func (_self *LoroList) Subscribe(subscriber Subscriber) **Subscription

Subscribe the events of a container.

The callback will be invoked when the container is changed. Returns a subscription that can be used to unsubscribe.

The events will be emitted after a transaction is committed. A transaction is committed when:

- `doc.commit()` is called. - `doc.export(mode)` is called. - `doc.import(data)` is called. - `doc.checkout(version)` is called.

func (*LoroList) SubscribeFn added in v0.4.0

func (l *LoroList) SubscribeFn(fn func(diff DiffEvent)) *Subscription

SubscribeFn is a convenience wrapper around LoroList.Subscribe that accepts a plain function instead of a Subscriber interface. Returns nil if the container is detached.

sub := list.SubscribeFn(func(diff loro.DiffEvent) {
	fmt.Println("list changed")
})
if sub != nil {
	defer sub.Unsubscribe()
}

func (*LoroList) ToVec

func (_self *LoroList) ToVec() []LoroValue

Converts the LoroList to a Vec of LoroValue.

This method unwraps the internal Arc and clones the data if necessary, returning a Vec containing all the elements of the LoroList as LoroValue.

type LoroListInterface

type LoroListInterface interface {
	// Delete all elements in the list.
	Clear() error
	// Delete values at the given position.
	Delete(pos uint32, len uint32) error
	// Get the LoroDoc from this container
	Doc() **LoroDoc
	// Get the value at the given position.
	Get(index uint32) **ValueOrContainer
	// If a detached container is attached, this method will return its corresponding attached handler.
	GetAttached() **LoroList
	GetCursor(pos uint32, side Side) **Cursor
	// Get the deep value of the container.
	GetDeepValue() LoroValue
	// Get the ID of the list item at the given position.
	GetIdAt(pos uint32) *Id
	// Get the shallow value of the container.
	//
	// This does not convert the state of sub-containers; instead, it represents them as [LoroValue::Container].
	GetValue() LoroValue
	// Get the ID of the container.
	Id() ContainerId
	// Insert a value at the given position.
	Insert(pos uint32, v LoroValueLike) error
	InsertCounterContainer(pos uint32, child *LoroCounter) (*LoroCounter, error)
	InsertListContainer(pos uint32, child *LoroList) (*LoroList, error)
	InsertMapContainer(pos uint32, child *LoroMap) (*LoroMap, error)
	InsertMovableListContainer(pos uint32, child *LoroMovableList) (*LoroMovableList, error)
	InsertTextContainer(pos uint32, child *LoroText) (*LoroText, error)
	InsertTreeContainer(pos uint32, child *LoroTree) (*LoroTree, error)
	// Whether the container is attached to a document
	//
	// The edits on a detached container will not be persisted.
	// To attach the container to the document, please insert it into an attached container.
	IsAttached() bool
	// Whether the container is deleted.
	IsDeleted() bool
	IsEmpty() bool
	Len() uint32
	// Pop the last element of the list.
	Pop() (*LoroValue, error)
	Push(v LoroValueLike) error
	// Subscribe the events of a container.
	//
	// The callback will be invoked when the container is changed.
	// Returns a subscription that can be used to unsubscribe.
	//
	// The events will be emitted after a transaction is committed. A transaction is committed when:
	//
	// - `doc.commit()` is called.
	// - `doc.export(mode)` is called.
	// - `doc.import(data)` is called.
	// - `doc.checkout(version)` is called.
	Subscribe(subscriber Subscriber) **Subscription
	// Converts the LoroList to a Vec of LoroValue.
	//
	// This method unwraps the internal Arc and clones the data if necessary,
	// returning a Vec containing all the elements of the LoroList as LoroValue.
	ToVec() []LoroValue
}

type LoroMap

type LoroMap struct {
	// contains filtered or unexported fields
}

func GetLoroMapContainer

func GetLoroMapContainer(v **ValueOrContainer) (*LoroMap, bool)

GetLoroMapContainer takes a pointer to a ValueOrContainer and returns the LoroMap value if it is a LoroMap.

func LiftFromExternalLoroMap added in v0.3.0

func LiftFromExternalLoroMap(handle uint64) *LoroMap

func NewLoroMap

func NewLoroMap() *LoroMap

Create a new container that is detached from the document.

The edits on a detached container will not be persisted. To attach the container to the document, please insert it into an attached container.

func (*LoroMap) All added in v0.4.0

func (m *LoroMap) All() iter.Seq2[string, *ValueOrContainer]

All yields each (key, value) pair. Iteration order matches the underlying Keys() result; a separate FFI lookup is issued per key, so breaking out early avoids the remaining lookups.

for k, v := range m.All() {
	// use k, v
}

func (*LoroMap) Attached added in v0.4.0

func (m *LoroMap) Attached() *LoroMap

Attached returns the live attached version of this container, or nil if the container has been detached and has no attached counterpart.

func (*LoroMap) Clear

func (_self *LoroMap) Clear() error

Delete all key-value pairs in the map.

func (*LoroMap) Delete

func (_self *LoroMap) Delete(key string) error

Delete a key-value pair from the map.

func (*LoroMap) Destroy

func (object *LoroMap) Destroy()

func (*LoroMap) Doc

func (_self *LoroMap) Doc() **LoroDoc

Get the LoroDoc from this container

func (*LoroMap) Get

func (_self *LoroMap) Get(key string) **ValueOrContainer

Get the value of the map with the given key.

func (*LoroMap) GetAny added in v0.4.0

func (m *LoroMap) GetAny(key string) (any, bool)

GetAny returns the value at key as an any, or (nil, false) if the key is absent. Nested containers are returned as their *LoroX wrapper.

func (*LoroMap) GetAttached

func (_self *LoroMap) GetAttached() **LoroMap

If a detached container is attached, this method will return its corresponding attached handler.

func (*LoroMap) GetBool added in v0.4.0

func (m *LoroMap) GetBool(key string) (bool, bool)

GetBool returns the bool value at key, or (false, false) if the key is absent or the value is not a bool.

func (*LoroMap) GetDeepValue

func (_self *LoroMap) GetDeepValue() LoroValue

Get the deep value of the map.

It will convert the state of sub-containers into a nested JSON value.

func (*LoroMap) GetFloat64 added in v0.4.0

func (m *LoroMap) GetFloat64(key string) (float64, bool)

GetFloat64 returns the float64 value at key, or (0, false) if the key is absent or the value is not a float64.

func (*LoroMap) GetInt64 added in v0.4.0

func (m *LoroMap) GetInt64(key string) (int64, bool)

GetInt64 returns the int64 value at key, or (0, false) if the key is absent or the value is not an int64.

func (*LoroMap) GetLastEditor

func (_self *LoroMap) GetLastEditor(key string) *uint64

Get the peer id of the last editor on the given entry

func (*LoroMap) GetList added in v0.4.0

func (m *LoroMap) GetList(key string) ([]LoroValue, bool)

GetList returns the list value at key as []LoroValue, or (nil, false) if the key is absent or the value is not a list.

func (*LoroMap) GetListOfAny added in v0.4.0

func (m *LoroMap) GetListOfAny(key string) ([]any, bool)

GetListOfAny returns the list value at key as []any, or (nil, false) if the key is absent or the value is not a list.

func (*LoroMap) GetLoroCounter added in v0.4.0

func (m *LoroMap) GetLoroCounter(key string) (*LoroCounter, bool)

GetLoroCounter returns the LoroCounter at key, or (nil, false) if the key is absent or the value is not a counter container.

func (*LoroMap) GetLoroList added in v0.4.0

func (m *LoroMap) GetLoroList(key string) (*LoroList, bool)

GetLoroList returns the LoroList at key, or (nil, false) if the key is absent or the value is not a list container.

func (*LoroMap) GetLoroMap added in v0.4.0

func (m *LoroMap) GetLoroMap(key string) (*LoroMap, bool)

GetLoroMap returns the LoroMap at key, or (nil, false) if the key is absent or the value is not a map container.

func (*LoroMap) GetLoroMovableList added in v0.4.0

func (m *LoroMap) GetLoroMovableList(key string) (*LoroMovableList, bool)

GetLoroMovableList returns the LoroMovableList at key, or (nil, false) if the key is absent or the value is not a movable list container.

func (*LoroMap) GetLoroText added in v0.4.0

func (m *LoroMap) GetLoroText(key string) (*LoroText, bool)

GetLoroText returns the LoroText at key, or (nil, false) if the key is absent or the value is not a text container.

func (*LoroMap) GetLoroTree added in v0.4.0

func (m *LoroMap) GetLoroTree(key string) (*LoroTree, bool)

GetLoroTree returns the LoroTree at key, or (nil, false) if the key is absent or the value is not a tree container.

func (*LoroMap) GetMap added in v0.4.0

func (m *LoroMap) GetMap(key string) (map[string]LoroValue, bool)

GetMap returns the map value at key as map[string]LoroValue, or (nil, false) if the key is absent or the value is not a map.

func (*LoroMap) GetMapOfAny added in v0.4.0

func (m *LoroMap) GetMapOfAny(key string) (map[string]any, bool)

GetMapOfAny returns the map value at key as map[string]any, or (nil, false) if the key is absent or the value is not a map.

func (*LoroMap) GetOrCreateCounterContainer

func (_self *LoroMap) GetOrCreateCounterContainer(key string, child *LoroCounter) (*LoroCounter, error)

func (*LoroMap) GetOrCreateListContainer

func (_self *LoroMap) GetOrCreateListContainer(key string, child *LoroList) (*LoroList, error)

func (*LoroMap) GetOrCreateLoroCounter added in v0.4.0

func (m *LoroMap) GetOrCreateLoroCounter(key string) (*LoroCounter, error)

GetOrCreateLoroCounter returns the LoroCounter child at key, creating an attached zero-valued one if absent.

func (*LoroMap) GetOrCreateLoroList added in v0.4.0

func (m *LoroMap) GetOrCreateLoroList(key string) (*LoroList, error)

GetOrCreateLoroList returns the LoroList child at key, creating an attached empty one if absent.

func (*LoroMap) GetOrCreateLoroMap added in v0.4.0

func (m *LoroMap) GetOrCreateLoroMap(key string) (*LoroMap, error)

GetOrCreateLoroMap returns the LoroMap child at key, creating an attached empty one if absent.

func (*LoroMap) GetOrCreateLoroMovableList added in v0.4.0

func (m *LoroMap) GetOrCreateLoroMovableList(key string) (*LoroMovableList, error)

GetOrCreateLoroMovableList returns the LoroMovableList child at key, creating an attached empty one if absent.

func (*LoroMap) GetOrCreateLoroText added in v0.4.0

func (m *LoroMap) GetOrCreateLoroText(key string) (*LoroText, error)

GetOrCreateLoroText returns the LoroText child at key, creating an attached empty one if absent.

func (*LoroMap) GetOrCreateLoroTree added in v0.4.0

func (m *LoroMap) GetOrCreateLoroTree(key string) (*LoroTree, error)

GetOrCreateLoroTree returns the LoroTree child at key, creating an attached empty one if absent.

func (*LoroMap) GetOrCreateMapContainer

func (_self *LoroMap) GetOrCreateMapContainer(key string, child *LoroMap) (*LoroMap, error)

func (*LoroMap) GetOrCreateMovableListContainer

func (_self *LoroMap) GetOrCreateMovableListContainer(key string, child *LoroMovableList) (*LoroMovableList, error)

func (*LoroMap) GetOrCreateTextContainer

func (_self *LoroMap) GetOrCreateTextContainer(key string, child *LoroText) (*LoroText, error)

func (*LoroMap) GetOrCreateTreeContainer

func (_self *LoroMap) GetOrCreateTreeContainer(key string, child *LoroTree) (*LoroTree, error)

func (*LoroMap) GetString added in v0.4.0

func (m *LoroMap) GetString(key string) (string, bool)

GetString returns the string value at key, or ("", false) if the key is absent or the value is not a string.

func (*LoroMap) GetValue

func (_self *LoroMap) GetValue() LoroValue

Get the shallow value of the map.

It will not convert the state of sub-containers, but represent them as [LoroValue::Container].

func (*LoroMap) Id

func (_self *LoroMap) Id() ContainerId

Get the ID of the map.

func (*LoroMap) Insert

func (_self *LoroMap) Insert(key string, v LoroValueLike) error

Insert a key-value pair into the map.

> **Note**: When calling `map.set(key, value)` on a LoroMap, if `map.get(key)` already returns `value`, > the operation will be a no-op (no operation recorded) to avoid unnecessary updates.

func (*LoroMap) InsertAny added in v0.4.0

func (m *LoroMap) InsertAny(key string, v any) error

InsertAny inserts a plain Go value at key. The value is converted via AsValue; passing an unsupported type returns an error without modifying the map.

func (*LoroMap) InsertCounterContainer

func (_self *LoroMap) InsertCounterContainer(key string, child *LoroCounter) (*LoroCounter, error)

func (*LoroMap) InsertListContainer

func (_self *LoroMap) InsertListContainer(key string, child *LoroList) (*LoroList, error)

func (*LoroMap) InsertMapContainer

func (_self *LoroMap) InsertMapContainer(key string, child *LoroMap) (*LoroMap, error)

func (*LoroMap) InsertMovableListContainer

func (_self *LoroMap) InsertMovableListContainer(key string, child *LoroMovableList) (*LoroMovableList, error)

func (*LoroMap) InsertTextContainer

func (_self *LoroMap) InsertTextContainer(key string, child *LoroText) (*LoroText, error)

func (*LoroMap) InsertTreeContainer

func (_self *LoroMap) InsertTreeContainer(key string, child *LoroTree) (*LoroTree, error)

func (*LoroMap) IsAttached

func (_self *LoroMap) IsAttached() bool

Whether the container is attached to a document.

func (*LoroMap) IsDeleted

func (_self *LoroMap) IsDeleted() bool

Whether the container is deleted.

func (*LoroMap) IsEmpty

func (_self *LoroMap) IsEmpty() bool

Whether the map is empty.

func (*LoroMap) IsExplicitlyNil added in v0.4.0

func (m *LoroMap) IsExplicitlyNil(key string) bool

IsExplicitlyNil reports whether the value at key is set to an explicit nil (LoroValueNull), as opposed to the key being absent.

func (*LoroMap) Keys

func (_self *LoroMap) Keys() []string

Get the keys of the map.

func (*LoroMap) Len

func (_self *LoroMap) Len() uint32

Get the length of the map.

func (*LoroMap) Lookup added in v0.4.0

func (m *LoroMap) Lookup(key string) *ValueOrContainer

Lookup returns the value at key, or nil if the key is absent.

if v := m.Lookup("name"); v != nil {
	// use v
}

func (*LoroMap) OwnerDoc added in v0.4.0

func (m *LoroMap) OwnerDoc() *LoroDoc

OwnerDoc returns the LoroDoc this container is attached to, or nil if it is detached.

func (*LoroMap) Subscribe

func (_self *LoroMap) Subscribe(subscriber Subscriber) **Subscription

Subscribe the events of a container.

The callback will be invoked when the container is changed. Returns a subscription that can be used to unsubscribe.

The events will be emitted after a transaction is committed. A transaction is committed when:

- `doc.commit()` is called. - `doc.export(mode)` is called. - `doc.import(data)` is called. - `doc.checkout(version)` is called.

func (*LoroMap) SubscribeFn added in v0.4.0

func (m *LoroMap) SubscribeFn(fn func(diff DiffEvent)) *Subscription

SubscribeFn is a convenience wrapper around LoroMap.Subscribe that accepts a plain function instead of a Subscriber interface. Returns nil if the container is detached.

sub := m.SubscribeFn(func(diff loro.DiffEvent) {
	fmt.Println("map changed")
})
if sub != nil {
	defer sub.Unsubscribe()
}

func (*LoroMap) Values

func (_self *LoroMap) Values() []*ValueOrContainer

Get the values of the map.

type LoroMapInterface

type LoroMapInterface interface {
	// Delete all key-value pairs in the map.
	Clear() error
	// Delete a key-value pair from the map.
	Delete(key string) error
	// Get the LoroDoc from this container
	Doc() **LoroDoc
	// Get the value of the map with the given key.
	Get(key string) **ValueOrContainer
	// If a detached container is attached, this method will return its corresponding attached handler.
	GetAttached() **LoroMap
	// Get the deep value of the map.
	//
	// It will convert the state of sub-containers into a nested JSON value.
	GetDeepValue() LoroValue
	// Get the peer id of the last editor on the given entry
	GetLastEditor(key string) *uint64
	GetOrCreateCounterContainer(key string, child *LoroCounter) (*LoroCounter, error)
	GetOrCreateListContainer(key string, child *LoroList) (*LoroList, error)
	GetOrCreateMapContainer(key string, child *LoroMap) (*LoroMap, error)
	GetOrCreateMovableListContainer(key string, child *LoroMovableList) (*LoroMovableList, error)
	GetOrCreateTextContainer(key string, child *LoroText) (*LoroText, error)
	GetOrCreateTreeContainer(key string, child *LoroTree) (*LoroTree, error)
	// Get the shallow value of the map.
	//
	// It will not convert the state of sub-containers, but represent them as [LoroValue::Container].
	GetValue() LoroValue
	// Get the ID of the map.
	Id() ContainerId
	// Insert a key-value pair into the map.
	//
	// > **Note**: When calling `map.set(key, value)` on a LoroMap, if `map.get(key)` already returns `value`,
	// > the operation will be a no-op (no operation recorded) to avoid unnecessary updates.
	Insert(key string, v LoroValueLike) error
	InsertCounterContainer(key string, child *LoroCounter) (*LoroCounter, error)
	InsertListContainer(key string, child *LoroList) (*LoroList, error)
	InsertMapContainer(key string, child *LoroMap) (*LoroMap, error)
	InsertMovableListContainer(key string, child *LoroMovableList) (*LoroMovableList, error)
	InsertTextContainer(key string, child *LoroText) (*LoroText, error)
	InsertTreeContainer(key string, child *LoroTree) (*LoroTree, error)
	// Whether the container is attached to a document.
	IsAttached() bool
	// Whether the container is deleted.
	IsDeleted() bool
	// Whether the map is empty.
	IsEmpty() bool
	// Get the keys of the map.
	Keys() []string
	// Get the length of the map.
	Len() uint32
	// Subscribe the events of a container.
	//
	// The callback will be invoked when the container is changed.
	// Returns a subscription that can be used to unsubscribe.
	//
	// The events will be emitted after a transaction is committed. A transaction is committed when:
	//
	// - `doc.commit()` is called.
	// - `doc.export(mode)` is called.
	// - `doc.import(data)` is called.
	// - `doc.checkout(version)` is called.
	Subscribe(subscriber Subscriber) **Subscription
	// Get the values of the map.
	Values() []*ValueOrContainer
}

type LoroMovableList

type LoroMovableList struct {
	// contains filtered or unexported fields
}

func GetLoroMovableListContainer

func GetLoroMovableListContainer(v **ValueOrContainer) (*LoroMovableList, bool)

GetLoroMovableListContainer takes a pointer to a ValueOrContainer and returns the LoroMovableList value if it is a LoroMovableList.

func LiftFromExternalLoroMovableList added in v0.3.0

func LiftFromExternalLoroMovableList(handle uint64) *LoroMovableList

func NewLoroMovableList

func NewLoroMovableList() *LoroMovableList

Create a new container that is detached from the document.

The edits on a detached container will not be persisted. To attach the container to the document, please insert it into an attached container.

func (*LoroMovableList) All added in v0.4.0

All yields each (index, element) pair in order. The element is a *ValueOrContainer so nested containers are reachable without a second lookup. Len is sampled once at the start.

func (*LoroMovableList) At added in v0.4.0

func (ml *LoroMovableList) At(index uint32) *ValueOrContainer

At returns the value at index, or nil if the index is out of bounds.

func (*LoroMovableList) Attached added in v0.4.0

func (ml *LoroMovableList) Attached() *LoroMovableList

Attached returns the live attached version of this container, or nil if the container has been detached and has no attached counterpart.

func (*LoroMovableList) Clear

func (_self *LoroMovableList) Clear() error

Delete all elements in the list.

func (*LoroMovableList) Cursor added in v0.4.0

func (ml *LoroMovableList) Cursor(pos uint32, side Side) *Cursor

Cursor creates a stable cursor at pos with the given side, or nil if a cursor cannot be created at that position.

func (*LoroMovableList) Delete

func (_self *LoroMovableList) Delete(pos uint32, len uint32) error

Delete values at the given position.

func (*LoroMovableList) Destroy

func (object *LoroMovableList) Destroy()

func (*LoroMovableList) Doc

func (_self *LoroMovableList) Doc() **LoroDoc

Get the LoroDoc from this container

func (*LoroMovableList) Get

func (_self *LoroMovableList) Get(index uint32) **ValueOrContainer

Get the value at the given position.

func (*LoroMovableList) GetAny added in v0.4.0

func (ml *LoroMovableList) GetAny(index uint32) (any, bool)

GetAny returns the value at index as an any, or (nil, false) if the index is out of bounds. Nested containers are returned as their *LoroX wrapper.

func (*LoroMovableList) GetAttached

func (_self *LoroMovableList) GetAttached() **LoroMovableList

If a detached container is attached, this method will return its corresponding attached handler.

func (*LoroMovableList) GetBool added in v0.4.0

func (ml *LoroMovableList) GetBool(index uint32) (bool, bool)

GetBool returns the bool value at index, or (false, false) if the index is out of bounds or the value is not a bool.

func (*LoroMovableList) GetCreatorAt

func (_self *LoroMovableList) GetCreatorAt(pos uint32) *uint64

func (*LoroMovableList) GetCursor

func (_self *LoroMovableList) GetCursor(pos uint32, side Side) **Cursor

Get the cursor at the given position.

Using "index" to denote cursor positions can be unstable, as positions may shift with document edits. To reliably represent a position or range within a document, it is more effective to leverage the unique ID of each item/character in a List CRDT or Text CRDT.

Loro optimizes State metadata by not storing the IDs of deleted elements. This approach complicates tracking cursors since they rely on these IDs. The solution recalculates position by replaying relevant history to update stable positions accurately. To minimize the performance impact of history replay, the system updates cursor info to reference only the IDs of currently present elements, thereby reducing the need for replay.

func (*LoroMovableList) GetDeepValue

func (_self *LoroMovableList) GetDeepValue() LoroValue

Get the deep value of the container.

func (*LoroMovableList) GetFloat64 added in v0.4.0

func (ml *LoroMovableList) GetFloat64(index uint32) (float64, bool)

GetFloat64 returns the float64 value at index, or (0, false) if the index is out of bounds or the value is not a float64.

func (*LoroMovableList) GetInt64 added in v0.4.0

func (ml *LoroMovableList) GetInt64(index uint32) (int64, bool)

GetInt64 returns the int64 value at index, or (0, false) if the index is out of bounds or the value is not an int64.

func (*LoroMovableList) GetLastEditorAt

func (_self *LoroMovableList) GetLastEditorAt(pos uint32) *uint64

Get the last editor of the list item at the given position.

func (*LoroMovableList) GetLastMoverAt

func (_self *LoroMovableList) GetLastMoverAt(pos uint32) *uint64

Get the last mover of the list item at the given position.

func (*LoroMovableList) GetList added in v0.4.0

func (ml *LoroMovableList) GetList(index uint32) ([]LoroValue, bool)

GetList returns the list value at index as []LoroValue, or (nil, false) if the index is out of bounds or the value is not a list.

func (*LoroMovableList) GetListOfAny added in v0.4.0

func (ml *LoroMovableList) GetListOfAny(index uint32) ([]any, bool)

GetListOfAny returns the list value at index as []any, or (nil, false) if the index is out of bounds or the value is not a list.

func (*LoroMovableList) GetLoroCounter added in v0.4.0

func (ml *LoroMovableList) GetLoroCounter(index uint32) (*LoroCounter, bool)

GetLoroCounter returns the LoroCounter at index, or (nil, false) if the index is out of bounds or the value is not a counter container.

func (*LoroMovableList) GetLoroList added in v0.4.0

func (ml *LoroMovableList) GetLoroList(index uint32) (*LoroList, bool)

GetLoroList returns the LoroList at index, or (nil, false) if the index is out of bounds or the value is not a list container.

func (*LoroMovableList) GetLoroMap added in v0.4.0

func (ml *LoroMovableList) GetLoroMap(index uint32) (*LoroMap, bool)

GetLoroMap returns the LoroMap at index, or (nil, false) if the index is out of bounds or the value is not a map container.

func (*LoroMovableList) GetLoroMovableList added in v0.4.0

func (ml *LoroMovableList) GetLoroMovableList(index uint32) (*LoroMovableList, bool)

GetLoroMovableList returns the LoroMovableList at index, or (nil, false) if the index is out of bounds or the value is not a movable list container.

func (*LoroMovableList) GetLoroText added in v0.4.0

func (ml *LoroMovableList) GetLoroText(index uint32) (*LoroText, bool)

GetLoroText returns the LoroText at index, or (nil, false) if the index is out of bounds or the value is not a text container.

func (*LoroMovableList) GetLoroTree added in v0.4.0

func (ml *LoroMovableList) GetLoroTree(index uint32) (*LoroTree, bool)

GetLoroTree returns the LoroTree at index, or (nil, false) if the index is out of bounds or the value is not a tree container.

func (*LoroMovableList) GetMap added in v0.4.0

func (ml *LoroMovableList) GetMap(index uint32) (map[string]LoroValue, bool)

GetMap returns the map value at index as map[string]LoroValue, or (nil, false) if the index is out of bounds or the value is not a map.

func (*LoroMovableList) GetMapOfAny added in v0.4.0

func (ml *LoroMovableList) GetMapOfAny(index uint32) (map[string]any, bool)

GetMapOfAny returns the map value at index as map[string]any, or (nil, false) if the index is out of bounds or the value is not a map.

func (*LoroMovableList) GetString added in v0.4.0

func (ml *LoroMovableList) GetString(index uint32) (string, bool)

GetString returns the string value at index, or ("", false) if the index is out of bounds or the value is not a string.

func (*LoroMovableList) GetValue

func (_self *LoroMovableList) GetValue() LoroValue

Get the shallow value of the container.

This does not convert the state of sub-containers; instead, it represents them as [LoroValue::Container].

func (*LoroMovableList) Id

func (_self *LoroMovableList) Id() ContainerId

Get the container id.

func (*LoroMovableList) Insert

func (_self *LoroMovableList) Insert(pos uint32, v LoroValueLike) error

Insert a value at the given position.

func (*LoroMovableList) InsertAny added in v0.4.0

func (ml *LoroMovableList) InsertAny(pos uint32, v any) error

InsertAny inserts a plain Go value at pos. The value is converted via AsValue; passing an unsupported type returns an error without modifying the list.

func (*LoroMovableList) InsertCounterContainer

func (_self *LoroMovableList) InsertCounterContainer(pos uint32, child *LoroCounter) (*LoroCounter, error)

func (*LoroMovableList) InsertListContainer

func (_self *LoroMovableList) InsertListContainer(pos uint32, child *LoroList) (*LoroList, error)

func (*LoroMovableList) InsertLoroCounter added in v0.4.0

func (ml *LoroMovableList) InsertLoroCounter(pos uint32) (*LoroCounter, error)

InsertLoroCounter inserts a fresh attached LoroCounter at pos and returns it.

func (*LoroMovableList) InsertLoroList added in v0.4.0

func (ml *LoroMovableList) InsertLoroList(pos uint32) (*LoroList, error)

InsertLoroList inserts a fresh attached LoroList at pos and returns it.

func (*LoroMovableList) InsertLoroMap added in v0.4.0

func (ml *LoroMovableList) InsertLoroMap(pos uint32) (*LoroMap, error)

InsertLoroMap inserts a fresh attached LoroMap at pos and returns it.

func (*LoroMovableList) InsertLoroMovableList added in v0.4.0

func (ml *LoroMovableList) InsertLoroMovableList(pos uint32) (*LoroMovableList, error)

InsertLoroMovableList inserts a fresh attached LoroMovableList at pos and returns it.

func (*LoroMovableList) InsertLoroText added in v0.4.0

func (ml *LoroMovableList) InsertLoroText(pos uint32) (*LoroText, error)

InsertLoroText inserts a fresh attached LoroText at pos and returns it.

func (*LoroMovableList) InsertLoroTree added in v0.4.0

func (ml *LoroMovableList) InsertLoroTree(pos uint32) (*LoroTree, error)

InsertLoroTree inserts a fresh attached LoroTree at pos and returns it.

func (*LoroMovableList) InsertMapContainer

func (_self *LoroMovableList) InsertMapContainer(pos uint32, child *LoroMap) (*LoroMap, error)

func (*LoroMovableList) InsertMovableListContainer

func (_self *LoroMovableList) InsertMovableListContainer(pos uint32, child *LoroMovableList) (*LoroMovableList, error)

func (*LoroMovableList) InsertTextContainer

func (_self *LoroMovableList) InsertTextContainer(pos uint32, child *LoroText) (*LoroText, error)

func (*LoroMovableList) InsertTreeContainer

func (_self *LoroMovableList) InsertTreeContainer(pos uint32, child *LoroTree) (*LoroTree, error)

func (*LoroMovableList) IsAttached

func (_self *LoroMovableList) IsAttached() bool

Whether the container is attached to a document

The edits on a detached container will not be persisted. To attach the container to the document, please insert it into an attached container.

func (*LoroMovableList) IsDeleted

func (_self *LoroMovableList) IsDeleted() bool

Whether the container is deleted.

func (*LoroMovableList) IsEmpty

func (_self *LoroMovableList) IsEmpty() bool

func (*LoroMovableList) IsExplicitlyNil added in v0.4.0

func (ml *LoroMovableList) IsExplicitlyNil(index uint32) bool

IsExplicitlyNil reports whether the value at index is set to an explicit nil (LoroValueNull), as opposed to the index being out of bounds.

func (*LoroMovableList) Len

func (_self *LoroMovableList) Len() uint32

func (*LoroMovableList) Mov

func (_self *LoroMovableList) Mov(from uint32, to uint32) error

Move the value at the given position to the given position.

func (*LoroMovableList) OwnerDoc added in v0.4.0

func (ml *LoroMovableList) OwnerDoc() *LoroDoc

OwnerDoc returns the LoroDoc this container is attached to, or nil if it is detached.

func (*LoroMovableList) Pop

func (_self *LoroMovableList) Pop() (**ValueOrContainer, error)

Pop the last element of the list.

func (*LoroMovableList) Push

func (_self *LoroMovableList) Push(v LoroValueLike) error

func (*LoroMovableList) PushAny added in v0.4.0

func (ml *LoroMovableList) PushAny(v any) error

PushAny appends a plain Go value. The value is converted via AsValue; passing an unsupported type returns an error without modifying the list.

func (*LoroMovableList) Set

func (_self *LoroMovableList) Set(pos uint32, value LoroValueLike) error

Set the value at the given position.

func (*LoroMovableList) SetAny added in v0.4.0

func (ml *LoroMovableList) SetAny(pos uint32, v any) error

SetAny replaces the value at pos with a plain Go value. The value is converted via AsValue; passing an unsupported type returns an error without modifying the list.

func (*LoroMovableList) SetCounterContainer

func (_self *LoroMovableList) SetCounterContainer(pos uint32, child *LoroCounter) (*LoroCounter, error)

func (*LoroMovableList) SetListContainer

func (_self *LoroMovableList) SetListContainer(pos uint32, child *LoroList) (*LoroList, error)

func (*LoroMovableList) SetMapContainer

func (_self *LoroMovableList) SetMapContainer(pos uint32, child *LoroMap) (*LoroMap, error)

func (*LoroMovableList) SetMovableListContainer

func (_self *LoroMovableList) SetMovableListContainer(pos uint32, child *LoroMovableList) (*LoroMovableList, error)

func (*LoroMovableList) SetTextContainer

func (_self *LoroMovableList) SetTextContainer(pos uint32, child *LoroText) (*LoroText, error)

func (*LoroMovableList) SetTreeContainer

func (_self *LoroMovableList) SetTreeContainer(pos uint32, child *LoroTree) (*LoroTree, error)

func (*LoroMovableList) Subscribe

func (_self *LoroMovableList) Subscribe(subscriber Subscriber) **Subscription

Subscribe the events of a container.

The callback will be invoked when the container is changed. Returns a subscription that can be used to unsubscribe.

The events will be emitted after a transaction is committed. A transaction is committed when:

- `doc.commit()` is called. - `doc.export(mode)` is called. - `doc.import(data)` is called. - `doc.checkout(version)` is called.

func (*LoroMovableList) SubscribeFn added in v0.4.0

func (ml *LoroMovableList) SubscribeFn(fn func(diff DiffEvent)) *Subscription

SubscribeFn is a convenience wrapper around LoroMovableList.Subscribe that accepts a plain function instead of a Subscriber interface. Returns nil if the container is detached.

sub := ml.SubscribeFn(func(diff loro.DiffEvent) {
	fmt.Println("movable list changed")
})
if sub != nil {
	defer sub.Unsubscribe()
}

func (*LoroMovableList) ToVec

func (_self *LoroMovableList) ToVec() []LoroValue

Get the elements of the list as a vector of LoroValues.

This method returns a vector containing all the elements in the list as LoroValues. It provides a convenient way to access the entire contents of the LoroMovableList as a standard Rust vector.

type LoroMovableListInterface

type LoroMovableListInterface interface {
	// Delete all elements in the list.
	Clear() error
	// Delete values at the given position.
	Delete(pos uint32, len uint32) error
	// Get the LoroDoc from this container
	Doc() **LoroDoc
	// Get the value at the given position.
	Get(index uint32) **ValueOrContainer
	// If a detached container is attached, this method will return its corresponding attached handler.
	GetAttached() **LoroMovableList
	GetCreatorAt(pos uint32) *uint64
	// Get the cursor at the given position.
	//
	// Using "index" to denote cursor positions can be unstable, as positions may
	// shift with document edits. To reliably represent a position or range within
	// a document, it is more effective to leverage the unique ID of each item/character
	// in a List CRDT or Text CRDT.
	//
	// Loro optimizes State metadata by not storing the IDs of deleted elements. This
	// approach complicates tracking cursors since they rely on these IDs. The solution
	// recalculates position by replaying relevant history to update stable positions
	// accurately. To minimize the performance impact of history replay, the system
	// updates cursor info to reference only the IDs of currently present elements,
	// thereby reducing the need for replay.
	GetCursor(pos uint32, side Side) **Cursor
	// Get the deep value of the container.
	GetDeepValue() LoroValue
	// Get the last editor of the list item at the given position.
	GetLastEditorAt(pos uint32) *uint64
	// Get the last mover of the list item at the given position.
	GetLastMoverAt(pos uint32) *uint64
	// Get the shallow value of the container.
	//
	// This does not convert the state of sub-containers; instead, it represents them as [LoroValue::Container].
	GetValue() LoroValue
	// Get the container id.
	Id() ContainerId
	// Insert a value at the given position.
	Insert(pos uint32, v LoroValueLike) error
	InsertCounterContainer(pos uint32, child *LoroCounter) (*LoroCounter, error)
	InsertListContainer(pos uint32, child *LoroList) (*LoroList, error)
	InsertMapContainer(pos uint32, child *LoroMap) (*LoroMap, error)
	InsertMovableListContainer(pos uint32, child *LoroMovableList) (*LoroMovableList, error)
	InsertTextContainer(pos uint32, child *LoroText) (*LoroText, error)
	InsertTreeContainer(pos uint32, child *LoroTree) (*LoroTree, error)
	// Whether the container is attached to a document
	//
	// The edits on a detached container will not be persisted.
	// To attach the container to the document, please insert it into an attached container.
	IsAttached() bool
	// Whether the container is deleted.
	IsDeleted() bool
	IsEmpty() bool
	Len() uint32
	// Move the value at the given position to the given position.
	Mov(from uint32, to uint32) error
	// Pop the last element of the list.
	Pop() (**ValueOrContainer, error)
	Push(v LoroValueLike) error
	// Set the value at the given position.
	Set(pos uint32, value LoroValueLike) error
	SetCounterContainer(pos uint32, child *LoroCounter) (*LoroCounter, error)
	SetListContainer(pos uint32, child *LoroList) (*LoroList, error)
	SetMapContainer(pos uint32, child *LoroMap) (*LoroMap, error)
	SetMovableListContainer(pos uint32, child *LoroMovableList) (*LoroMovableList, error)
	SetTextContainer(pos uint32, child *LoroText) (*LoroText, error)
	SetTreeContainer(pos uint32, child *LoroTree) (*LoroTree, error)
	// Subscribe the events of a container.
	//
	// The callback will be invoked when the container is changed.
	// Returns a subscription that can be used to unsubscribe.
	//
	// The events will be emitted after a transaction is committed. A transaction is committed when:
	//
	// - `doc.commit()` is called.
	// - `doc.export(mode)` is called.
	// - `doc.import(data)` is called.
	// - `doc.checkout(version)` is called.
	Subscribe(subscriber Subscriber) **Subscription
	// Get the elements of the list as a vector of LoroValues.
	//
	// This method returns a vector containing all the elements in the list as LoroValues.
	// It provides a convenient way to access the entire contents of the LoroMovableList
	// as a standard Rust vector.
	ToVec() []LoroValue
}

type LoroText

type LoroText struct {
	// contains filtered or unexported fields
}

func GetLoroTextContainer

func GetLoroTextContainer(v **ValueOrContainer) (*LoroText, bool)

GetLoroTextContainer takes a pointer to a ValueOrContainer and returns the LoroText value if it is a LoroText.

func LiftFromExternalLoroText added in v0.3.0

func LiftFromExternalLoroText(handle uint64) *LoroText

func NewLoroText

func NewLoroText() *LoroText

Create a new container that is detached from the document.

The edits on a detached container will not be persisted. To attach the container to the document, please insert it into an attached container.

func (*LoroText) ApplyDelta

func (_self *LoroText) ApplyDelta(delta []TextDelta) error

Apply a [delta](https://quilljs.com/docs/delta/) to the text container.

func (*LoroText) Attached added in v0.4.0

func (t *LoroText) Attached() *LoroText

Attached returns the live attached version of this container, or nil if the container has been detached and has no attached counterpart.

func (*LoroText) CharAt

func (_self *LoroText) CharAt(pos uint32) (string, error)

Get the characters at given unicode position.

func (*LoroText) ConvertPos added in v0.2.0

func (_self *LoroText) ConvertPos(index uint32, from PosType, to PosType) *uint32

Convert a position between coordinate systems (Unicode, UTF-16, UTF-8 bytes, Event).

func (*LoroText) Cursor added in v0.4.0

func (t *LoroText) Cursor(pos uint32, side Side) *Cursor

Cursor creates a stable cursor at pos with the given side, or nil if a cursor cannot be created at that position.

func (*LoroText) Delete

func (_self *LoroText) Delete(pos uint32, len uint32) error

Delete a range of text at the given unicode position with unicode length.

func (*LoroText) DeleteUtf8

func (_self *LoroText) DeleteUtf8(pos uint32, len uint32) error

Delete a range of text at the given utf-8 position with utf-8 length.

func (*LoroText) DeleteUtf16 added in v0.2.0

func (_self *LoroText) DeleteUtf16(pos uint32, len uint32) error

Delete a range of text at the given utf-16 position with utf-16 length.

func (*LoroText) Destroy

func (object *LoroText) Destroy()

func (*LoroText) Doc

func (_self *LoroText) Doc() **LoroDoc

Get the LoroDoc from this container

func (*LoroText) GetAttached

func (_self *LoroText) GetAttached() **LoroText

If a detached container is attached, this method will return its corresponding attached handler.

func (*LoroText) GetCursor

func (_self *LoroText) GetCursor(pos uint32, side Side) **Cursor

Get the cursor at the given position in the given Unicode position..

Using "index" to denote cursor positions can be unstable, as positions may shift with document edits. To reliably represent a position or range within a document, it is more effective to leverage the unique ID of each item/character in a List CRDT or Text CRDT.

Loro optimizes State metadata by not storing the IDs of deleted elements. This approach complicates tracking cursors since they rely on these IDs. The solution recalculates position by replaying relevant history to update stable positions accurately. To minimize the performance impact of history replay, the system updates cursor info to reference only the IDs of currently present elements, thereby reducing the need for replay.

func (*LoroText) GetEditorAtUnicodePos

func (_self *LoroText) GetEditorAtUnicodePos(pos uint32) *uint64

Get the editor of the text at the given position.

func (*LoroText) GetRichtextValue

func (_self *LoroText) GetRichtextValue() LoroValue

Get the text in [Delta](https://quilljs.com/docs/delta/) format.

func (*LoroText) Id

func (_self *LoroText) Id() ContainerId

Get the [ContainerID] of the text container.

func (*LoroText) Insert

func (_self *LoroText) Insert(pos uint32, s string) error

Insert a string at the given unicode position.

func (*LoroText) InsertUtf8

func (_self *LoroText) InsertUtf8(pos uint32, s string) error

Insert a string at the given utf-8 position.

func (*LoroText) InsertUtf16 added in v0.2.0

func (_self *LoroText) InsertUtf16(pos uint32, s string) error

Insert a string at the given utf-16 position.

func (*LoroText) IsAttached

func (_self *LoroText) IsAttached() bool

Whether the container is attached to a document

The edits on a detached container will not be persisted. To attach the container to the document, please insert it into an attached container.

func (*LoroText) IsDeleted

func (_self *LoroText) IsDeleted() bool

Whether the container is deleted.

func (*LoroText) IsEmpty

func (_self *LoroText) IsEmpty() bool

Whether the text container is empty.

func (*LoroText) LenUnicode

func (_self *LoroText) LenUnicode() uint32

Get the length of the text container in Unicode.

func (*LoroText) LenUtf8

func (_self *LoroText) LenUtf8() uint32

Get the length of the text container in UTF-8.

func (*LoroText) LenUtf16

func (_self *LoroText) LenUtf16() uint32

Get the length of the text container in UTF-16.

func (*LoroText) Mark

func (_self *LoroText) Mark(from uint32, to uint32, key string, value LoroValueLike) error

Mark a range of text with a key-value pair.

You can use it to create a highlight, make a range of text bold, or add a link to a range of text.

You can specify the `expand` option to set the behavior when inserting text at the boundary of the range.

- `after`(default): when inserting text right after the given range, the mark will be expanded to include the inserted text - `before`: when inserting text right before the given range, the mark will be expanded to include the inserted text - `none`: the mark will not be expanded to include the inserted text at the boundaries - `both`: when inserting text either right before or right after the given range, the mark will be expanded to include the inserted text

*You should make sure that a key is always associated with the same expand type.*

Note: this is not suitable for unmergeable annotations like comments.

func (*LoroText) MarkAny added in v0.4.0

func (t *LoroText) MarkAny(from uint32, to uint32, key string, v any) error

MarkAny applies a mark with a plain Go value over [from, to). The value is converted via AsValue; passing an unsupported type returns an error without applying the mark.

func (*LoroText) MarkUtf8 added in v0.2.0

func (_self *LoroText) MarkUtf8(from uint32, to uint32, key string, value LoroValueLike) error

Mark a range of text with UTF-8 offsets.

func (*LoroText) MarkUtf8Any added in v0.4.0

func (t *LoroText) MarkUtf8Any(from uint32, to uint32, key string, v any) error

MarkUtf8Any applies a mark with a plain Go value over a UTF-8 range. The value is converted via AsValue; passing an unsupported type returns an error without applying the mark.

func (*LoroText) MarkUtf16 added in v0.2.0

func (_self *LoroText) MarkUtf16(from uint32, to uint32, key string, value LoroValueLike) error

Mark a range of text with UTF-16 offsets.

func (*LoroText) MarkUtf16Any added in v0.4.0

func (t *LoroText) MarkUtf16Any(from uint32, to uint32, key string, v any) error

MarkUtf16Any applies a mark with a plain Go value over a UTF-16 range. The value is converted via AsValue; passing an unsupported type returns an error without applying the mark.

func (*LoroText) OwnerDoc added in v0.4.0

func (t *LoroText) OwnerDoc() *LoroDoc

OwnerDoc returns the LoroDoc this container is attached to, or nil if it is detached.

func (*LoroText) PushStr

func (_self *LoroText) PushStr(s string) error

Push a string to the end of the text container.

func (*LoroText) Slice

func (_self *LoroText) Slice(startIndex uint32, endIndex uint32) (string, error)

Get a string slice at the given Unicode range

func (*LoroText) SliceDelta added in v0.2.0

func (_self *LoroText) SliceDelta(startIndex uint32, endIndex uint32, posType PosType) ([]TextDelta, error)

Get the rich-text delta within a range.

func (*LoroText) SliceUtf16 added in v0.2.0

func (_self *LoroText) SliceUtf16(startIndex uint32, endIndex uint32) (string, error)

Get a string slice at the given UTF-16 range

func (*LoroText) Splice

func (_self *LoroText) Splice(pos uint32, len uint32, s string) (string, error)

Delete specified character and insert string at the same position at given unicode position.

func (*LoroText) SpliceUtf16 added in v0.2.0

func (_self *LoroText) SpliceUtf16(pos uint32, len uint32, s string) error

Delete specified range and insert a string at the same UTF-16 position.

func (*LoroText) String added in v0.2.0

func (_self *LoroText) String() string

func (*LoroText) Subscribe

func (_self *LoroText) Subscribe(subscriber Subscriber) **Subscription

Subscribe the events of a container.

The callback will be invoked when the container is changed. Returns a subscription that can be used to unsubscribe.

The events will be emitted after a transaction is committed. A transaction is committed when:

- `doc.commit()` is called. - `doc.export(mode)` is called. - `doc.import(data)` is called. - `doc.checkout(version)` is called.

func (*LoroText) SubscribeFn added in v0.4.0

func (t *LoroText) SubscribeFn(fn func(diff DiffEvent)) *Subscription

SubscribeFn is a convenience wrapper around LoroText.Subscribe that accepts a plain function instead of a Subscriber interface. Returns nil if the container is detached.

sub := text.SubscribeFn(func(diff loro.DiffEvent) {
	fmt.Println("text changed")
})
if sub != nil {
	defer sub.Unsubscribe()
}

func (*LoroText) ToDelta

func (_self *LoroText) ToDelta() []TextDelta

Get the text in [Delta](https://quilljs.com/docs/delta/) format.

func (*LoroText) Unmark

func (_self *LoroText) Unmark(from uint32, to uint32, key string) error

Unmark a range of text with a key and a value.

You can specify the `expand` option to set the behavior when inserting text at the boundary of the range.

**Note: You should specify the same expand type as when you mark the text.**

- `after`(default): when inserting text right after the given range, the mark will be expanded to include the inserted text - `before`: when inserting text right before the given range, the mark will be expanded to include the inserted text - `none`: the mark will not be expanded to include the inserted text at the boundaries - `both`: when inserting text either right before or right after the given range, the mark will be expanded to include the inserted text

*You should make sure that a key is always associated with the same expand type.*

Note: you cannot delete unmergeable annotations like comments by this method.

func (*LoroText) UnmarkUtf16 added in v0.2.0

func (_self *LoroText) UnmarkUtf16(from uint32, to uint32, key string) error

Unmark a UTF-16 range of text with a key.

func (*LoroText) Update

func (_self *LoroText) Update(s string, options UpdateOptions) error

Update the current text based on the provided text.

It will calculate the minimal difference and apply it to the current text. It uses Myers' diff algorithm to compute the optimal difference.

This could take a long time for large texts (e.g. > 50_000 characters). In that case, you should use `updateByLine` instead.

func (*LoroText) UpdateByLine

func (_self *LoroText) UpdateByLine(s string, options UpdateOptions) error

Update the current text based on the provided text.

This update calculation is line-based, which will be more efficient but less precise.

type LoroTextInterface

type LoroTextInterface interface {
	// Apply a [delta](https://quilljs.com/docs/delta/) to the text container.
	ApplyDelta(delta []TextDelta) error
	// Get the characters at given unicode position.
	CharAt(pos uint32) (string, error)
	// Convert a position between coordinate systems (Unicode, UTF-16, UTF-8 bytes, Event).
	ConvertPos(index uint32, from PosType, to PosType) *uint32
	// Delete a range of text at the given unicode position with unicode length.
	Delete(pos uint32, len uint32) error
	// Delete a range of text at the given utf-16 position with utf-16 length.
	DeleteUtf16(pos uint32, len uint32) error
	// Delete a range of text at the given utf-8 position with utf-8 length.
	DeleteUtf8(pos uint32, len uint32) error
	// Get the LoroDoc from this container
	Doc() **LoroDoc
	// If a detached container is attached, this method will return its corresponding attached handler.
	GetAttached() **LoroText
	// Get the cursor at the given position in the given Unicode position..
	//
	// Using "index" to denote cursor positions can be unstable, as positions may
	// shift with document edits. To reliably represent a position or range within
	// a document, it is more effective to leverage the unique ID of each item/character
	// in a List CRDT or Text CRDT.
	//
	// Loro optimizes State metadata by not storing the IDs of deleted elements. This
	// approach complicates tracking cursors since they rely on these IDs. The solution
	// recalculates position by replaying relevant history to update stable positions
	// accurately. To minimize the performance impact of history replay, the system
	// updates cursor info to reference only the IDs of currently present elements,
	// thereby reducing the need for replay.
	GetCursor(pos uint32, side Side) **Cursor
	// Get the editor of the text at the given position.
	GetEditorAtUnicodePos(pos uint32) *uint64
	// Get the text in [Delta](https://quilljs.com/docs/delta/) format.
	GetRichtextValue() LoroValue
	// Get the [ContainerID]  of the text container.
	Id() ContainerId
	// Insert a string at the given unicode position.
	Insert(pos uint32, s string) error
	// Insert a string at the given utf-16 position.
	InsertUtf16(pos uint32, s string) error
	// Insert a string at the given utf-8 position.
	InsertUtf8(pos uint32, s string) error
	// Whether the container is attached to a document
	//
	// The edits on a detached container will not be persisted.
	// To attach the container to the document, please insert it into an attached container.
	IsAttached() bool
	// Whether the container is deleted.
	IsDeleted() bool
	// Whether the text container is empty.
	IsEmpty() bool
	// Get the length of the text container in Unicode.
	LenUnicode() uint32
	// Get the length of the text container in UTF-16.
	LenUtf16() uint32
	// Get the length of the text container in UTF-8.
	LenUtf8() uint32
	// Mark a range of text with a key-value pair.
	//
	// You can use it to create a highlight, make a range of text bold, or add a link to a range of text.
	//
	// You can specify the `expand` option to set the behavior when inserting text at the boundary of the range.
	//
	// - `after`(default): when inserting text right after the given range, the mark will be expanded to include the inserted text
	// - `before`: when inserting text right before the given range, the mark will be expanded to include the inserted text
	// - `none`: the mark will not be expanded to include the inserted text at the boundaries
	// - `both`: when inserting text either right before or right after the given range, the mark will be expanded to include the inserted text
	//
	// *You should make sure that a key is always associated with the same expand type.*
	//
	// Note: this is not suitable for unmergeable annotations like comments.
	Mark(from uint32, to uint32, key string, value LoroValueLike) error
	// Mark a range of text with UTF-16 offsets.
	MarkUtf16(from uint32, to uint32, key string, value LoroValueLike) error
	// Mark a range of text with UTF-8 offsets.
	MarkUtf8(from uint32, to uint32, key string, value LoroValueLike) error
	// Push a string to the end of the text container.
	PushStr(s string) error
	// Get a string slice at the given Unicode range
	Slice(startIndex uint32, endIndex uint32) (string, error)
	// Get the rich-text delta within a range.
	SliceDelta(startIndex uint32, endIndex uint32, posType PosType) ([]TextDelta, error)
	// Get a string slice at the given UTF-16 range
	SliceUtf16(startIndex uint32, endIndex uint32) (string, error)
	// Delete specified character and insert string at the same position at given unicode position.
	Splice(pos uint32, len uint32, s string) (string, error)
	// Delete specified range and insert a string at the same UTF-16 position.
	SpliceUtf16(pos uint32, len uint32, s string) error
	// Subscribe the events of a container.
	//
	// The callback will be invoked when the container is changed.
	// Returns a subscription that can be used to unsubscribe.
	//
	// The events will be emitted after a transaction is committed. A transaction is committed when:
	//
	// - `doc.commit()` is called.
	// - `doc.export(mode)` is called.
	// - `doc.import(data)` is called.
	// - `doc.checkout(version)` is called.
	Subscribe(subscriber Subscriber) **Subscription
	// Get the text in [Delta](https://quilljs.com/docs/delta/) format.
	ToDelta() []TextDelta
	// Unmark a range of text with a key and a value.
	//
	// You can use it to remove highlights, bolds or links
	//
	// You can specify the `expand` option to set the behavior when inserting text at the boundary of the range.
	//
	// **Note: You should specify the same expand type as when you mark the text.**
	//
	// - `after`(default): when inserting text right after the given range, the mark will be expanded to include the inserted text
	// - `before`: when inserting text right before the given range, the mark will be expanded to include the inserted text
	// - `none`: the mark will not be expanded to include the inserted text at the boundaries
	// - `both`: when inserting text either right before or right after the given range, the mark will be expanded to include the inserted text
	//
	// *You should make sure that a key is always associated with the same expand type.*
	//
	// Note: you cannot delete unmergeable annotations like comments by this method.
	Unmark(from uint32, to uint32, key string) error
	// Unmark a UTF-16 range of text with a key.
	UnmarkUtf16(from uint32, to uint32, key string) error
	// Update the current text based on the provided text.
	//
	// It will calculate the minimal difference and apply it to the current text.
	// It uses Myers' diff algorithm to compute the optimal difference.
	//
	// This could take a long time for large texts (e.g. > 50_000 characters).
	// In that case, you should use `updateByLine` instead.
	Update(s string, options UpdateOptions) error
	// Update the current text based on the provided text.
	//
	// This update calculation is line-based, which will be more efficient but less precise.
	UpdateByLine(s string, options UpdateOptions) error
}

type LoroTree

type LoroTree struct {
	// contains filtered or unexported fields
}

func GetLoroTreeContainer

func GetLoroTreeContainer(v **ValueOrContainer) (*LoroTree, bool)

GetLoroTreeContainer takes a pointer to a ValueOrContainer and returns the LoroTree value if it is a LoroTree.

func LiftFromExternalLoroTree added in v0.3.0

func LiftFromExternalLoroTree(handle uint64) *LoroTree

func NewLoroTree

func NewLoroTree() *LoroTree

Create a new container that is detached from the document.

The edits on a detached container will not be persisted. To attach the container to the document, please insert it into an attached container.

func (*LoroTree) AllChildren added in v0.4.0

func (t *LoroTree) AllChildren(parent TreeParentId) iter.Seq[TreeId]

AllChildren yields each direct child of parent. Yields nothing if parent is unknown or has no children.

func (*LoroTree) AllNodes added in v0.4.0

func (t *LoroTree) AllNodes() iter.Seq[TreeId]

AllNodes yields every node id in the tree, in the order returned by Nodes.

func (*LoroTree) AllRoots added in v0.4.0

func (t *LoroTree) AllRoots() iter.Seq[TreeId]

AllRoots yields every root node id, in the order returned by Roots.

func (*LoroTree) Attached added in v0.4.0

func (tr *LoroTree) Attached() *LoroTree

Attached returns the live attached version of this container, or nil if the container has been detached and has no attached counterpart.

func (*LoroTree) Children

func (_self *LoroTree) Children(parent TreeParentId) *[]TreeId

Return all children of the target node.

If the parent node does not exist, return `None`.

func (*LoroTree) ChildrenNum

func (_self *LoroTree) ChildrenNum(parent TreeParentId) *uint32

Return the number of children of the target node.

func (*LoroTree) Contains

func (_self *LoroTree) Contains(target TreeId) bool

Return whether target node exists.

func (*LoroTree) Create

func (_self *LoroTree) Create(parent TreeParentId) (TreeId, error)

Create a new tree node and return the [`TreeID`].

If the `parent` is `None`, the created node is the root of a tree. Otherwise, the created node is a child of the parent tree node.

func (*LoroTree) CreateAt

func (_self *LoroTree) CreateAt(parent TreeParentId, index uint32) (TreeId, error)

Create a new tree node at the given index and return the [`TreeID`].

If the `parent` is `None`, the created node is the root of a tree. If the `index` is greater than the number of children of the parent, error will be returned.

func (*LoroTree) Delete

func (_self *LoroTree) Delete(target TreeId) error

Delete a tree node.

Note: If the deleted node has children, the children do not appear in the state rather than actually being deleted.

func (*LoroTree) Destroy

func (object *LoroTree) Destroy()

func (*LoroTree) DisableFractionalIndex

func (_self *LoroTree) DisableFractionalIndex()

Disable the fractional index generation when you don't need the Tree's siblings to be sorted. The fractional index will always be set to the same default value 0.

After calling this, you cannot use `tree.moveTo()`, `tree.moveBefore()`, `tree.moveAfter()`, and `tree.createAt()`.

func (*LoroTree) Doc

func (_self *LoroTree) Doc() **LoroDoc

Get the LoroDoc from this container

func (*LoroTree) EnableFractionalIndex

func (_self *LoroTree) EnableFractionalIndex(jitter uint8)

Enable fractional index for Tree Position.

The jitter is used to avoid conflicts when multiple users are creating the node at the same position. value 0 is default, which means no jitter, any value larger than 0 will enable jitter.

Generally speaking, jitter will affect the growth rate of document size. [Read more about it](https://www.loro.dev/blog/movable-tree#implementation-and-encoding-size)

func (*LoroTree) FractionalIndex

func (_self *LoroTree) FractionalIndex(target TreeId) *string

Return the fractional index of the target node with hex format.

func (*LoroTree) GetAttached

func (_self *LoroTree) GetAttached() **LoroTree

If a detached container is attached, this method will return its corresponding attached handler.

func (*LoroTree) GetLastMoveId

func (_self *LoroTree) GetLastMoveId(target TreeId) *Id

Get the last move id of the target node.

func (*LoroTree) GetMeta

func (_self *LoroTree) GetMeta(target TreeId) (*LoroMap, error)

Get the associated metadata map handler of a tree node.

func (*LoroTree) GetValue

func (_self *LoroTree) GetValue() LoroValue

Return the flat array of the forest.

Note: the metadata will be not resolved. So if you don't only care about hierarchy but also the metadata, you should use `get_value_with_meta()`.

func (*LoroTree) GetValueWithMeta

func (_self *LoroTree) GetValueWithMeta() LoroValue

Return the flat array of the forest, each node is with metadata.

func (*LoroTree) Id

func (_self *LoroTree) Id() ContainerId

Return container id of the tree.

func (*LoroTree) IsAttached

func (_self *LoroTree) IsAttached() bool

Whether the container is attached to a document

The edits on a detached container will not be persisted. To attach the container to the document, please insert it into an attached container.

func (*LoroTree) IsDeleted

func (_self *LoroTree) IsDeleted() bool

Whether the container is deleted.

func (*LoroTree) IsFractionalIndexEnabled

func (_self *LoroTree) IsFractionalIndexEnabled() bool

Whether the fractional index is enabled.

func (*LoroTree) IsNodeDeleted

func (_self *LoroTree) IsNodeDeleted(target TreeId) (bool, error)

Return whether target node is deleted.

# Errors - If the target node does not exist, return `LoroTreeError::TreeNodeNotExist`.

func (*LoroTree) Mov

func (_self *LoroTree) Mov(target TreeId, parent TreeParentId) error

Move the `target` node to be a child of the `parent` node.

If the `parent` is `None`, the `target` node will be a root.

func (*LoroTree) MovAfter

func (_self *LoroTree) MovAfter(target TreeId, after TreeId) error

Move the `target` node to be a child after the `after` node with the same parent.

func (*LoroTree) MovBefore

func (_self *LoroTree) MovBefore(target TreeId, before TreeId) error

Move the `target` node to be a child before the `before` node with the same parent.

func (*LoroTree) MovTo

func (_self *LoroTree) MovTo(target TreeId, parent TreeParentId, to uint32) error

Move the `target` node to be a child of the `parent` node at the given index. If the `parent` is `None`, the `target` node will be a root.

func (*LoroTree) Nodes

func (_self *LoroTree) Nodes() []TreeId

Return all nodes, including deleted nodes

func (*LoroTree) OwnerDoc added in v0.4.0

func (tr *LoroTree) OwnerDoc() *LoroDoc

OwnerDoc returns the LoroDoc this container is attached to, or nil if it is detached.

func (*LoroTree) Parent

func (_self *LoroTree) Parent(target TreeId) (TreeParentId, error)

Return the parent of target node.

- If the target node does not exist, throws Error. - If the target node is a root node, return nil.

func (*LoroTree) Roots

func (_self *LoroTree) Roots() []TreeId

Get the root nodes of the forest.

func (*LoroTree) Subscribe

func (_self *LoroTree) Subscribe(subscriber Subscriber) **Subscription

Subscribe the events of a container.

The callback will be invoked when the container is changed. Returns a subscription that can be used to unsubscribe.

The events will be emitted after a transaction is committed. A transaction is committed when:

- `doc.commit()` is called. - `doc.export(mode)` is called. - `doc.import(data)` is called. - `doc.checkout(version)` is called.

func (*LoroTree) SubscribeFn added in v0.4.0

func (tr *LoroTree) SubscribeFn(fn func(diff DiffEvent)) *Subscription

SubscribeFn is a convenience wrapper around LoroTree.Subscribe that accepts a plain function instead of a Subscriber interface. Returns nil if the container is detached.

sub := tree.SubscribeFn(func(diff loro.DiffEvent) {
	fmt.Println("tree changed")
})
if sub != nil {
	defer sub.Unsubscribe()
}

type LoroTreeInterface

type LoroTreeInterface interface {
	// Return all children of the target node.
	//
	// If the parent node does not exist, return `None`.
	Children(parent TreeParentId) *[]TreeId
	// Return the number of children of the target node.
	ChildrenNum(parent TreeParentId) *uint32
	// Return whether target node exists.
	Contains(target TreeId) bool
	// Create a new tree node and return the [`TreeID`].
	//
	// If the `parent` is `None`, the created node is the root of a tree.
	// Otherwise, the created node is a child of the parent tree node.
	Create(parent TreeParentId) (TreeId, error)
	// Create a new tree node at the given index and return the [`TreeID`].
	//
	// If the `parent` is `None`, the created node is the root of a tree.
	// If the `index` is greater than the number of children of the parent, error will be returned.
	CreateAt(parent TreeParentId, index uint32) (TreeId, error)
	// Delete a tree node.
	//
	// Note: If the deleted node has children, the children do not appear in the state
	// rather than actually being deleted.
	Delete(target TreeId) error
	// Disable the fractional index generation when you don't need the Tree's siblings to be sorted.
	// The fractional index will always be set to the same default value 0.
	//
	// After calling this, you cannot use `tree.moveTo()`, `tree.moveBefore()`, `tree.moveAfter()`,
	// and `tree.createAt()`.
	DisableFractionalIndex()
	// Get the LoroDoc from this container
	Doc() **LoroDoc
	// Enable fractional index for Tree Position.
	//
	// The jitter is used to avoid conflicts when multiple users are creating the node at the same position.
	// value 0 is default, which means no jitter, any value larger than 0 will enable jitter.
	//
	// Generally speaking, jitter will affect the growth rate of document size.
	// [Read more about it](https://www.loro.dev/blog/movable-tree#implementation-and-encoding-size)
	EnableFractionalIndex(jitter uint8)
	// Return the fractional index of the target node with hex format.
	FractionalIndex(target TreeId) *string
	// If a detached container is attached, this method will return its corresponding attached handler.
	GetAttached() **LoroTree
	// Get the last move id of the target node.
	GetLastMoveId(target TreeId) *Id
	// Get the associated metadata map handler of a tree node.
	GetMeta(target TreeId) (*LoroMap, error)
	// Return the flat array of the forest.
	//
	// Note: the metadata will be not resolved. So if you don't only care about hierarchy
	// but also the metadata, you should use `get_value_with_meta()`.
	GetValue() LoroValue
	// Return the flat array of the forest, each node is with metadata.
	GetValueWithMeta() LoroValue
	// Return container id of the tree.
	Id() ContainerId
	// Whether the container is attached to a document
	//
	// The edits on a detached container will not be persisted.
	// To attach the container to the document, please insert it into an attached container.
	IsAttached() bool
	// Whether the container is deleted.
	IsDeleted() bool
	// Whether the fractional index is enabled.
	IsFractionalIndexEnabled() bool
	// Return whether target node is deleted.
	//
	// # Errors
	// - If the target node does not exist, return `LoroTreeError::TreeNodeNotExist`.
	IsNodeDeleted(target TreeId) (bool, error)
	// Move the `target` node to be a child of the `parent` node.
	//
	// If the `parent` is `None`, the `target` node will be a root.
	Mov(target TreeId, parent TreeParentId) error
	// Move the `target` node to be a child after the `after` node with the same parent.
	MovAfter(target TreeId, after TreeId) error
	// Move the `target` node to be a child before the `before` node with the same parent.
	MovBefore(target TreeId, before TreeId) error
	// Move the `target` node to be a child of the `parent` node at the given index.
	// If the `parent` is `None`, the `target` node will be a root.
	MovTo(target TreeId, parent TreeParentId, to uint32) error
	// Return all nodes, including deleted nodes
	Nodes() []TreeId
	// Return the parent of target node.
	//
	// - If the target node does not exist, throws Error.
	// - If the target node is a root node, return nil.
	Parent(target TreeId) (TreeParentId, error)
	// Get the root nodes of the forest.
	Roots() []TreeId
	// Subscribe the events of a container.
	//
	// The callback will be invoked when the container is changed.
	// Returns a subscription that can be used to unsubscribe.
	//
	// The events will be emitted after a transaction is committed. A transaction is committed when:
	//
	// - `doc.commit()` is called.
	// - `doc.export(mode)` is called.
	// - `doc.import(data)` is called.
	// - `doc.checkout(version)` is called.
	Subscribe(subscriber Subscriber) **Subscription
}

type LoroUnknown

type LoroUnknown struct {
	// contains filtered or unexported fields
}

func LiftFromExternalLoroUnknown added in v0.3.0

func LiftFromExternalLoroUnknown(handle uint64) *LoroUnknown

func (*LoroUnknown) Destroy

func (object *LoroUnknown) Destroy()

func (*LoroUnknown) Id

func (_self *LoroUnknown) Id() ContainerId

Get the container id.

type LoroUnknownInterface

type LoroUnknownInterface interface {
	// Get the container id.
	Id() ContainerId
}

type LoroValue

type LoroValue interface {
	Destroy()
}

func GetListValue

func GetListValue(v **ValueOrContainer) ([]LoroValue, bool)

GetListValue takes a pointer to a ValueOrContainer and returns the list value if it is a list.

func GetValue

func GetValue(v **ValueOrContainer) (LoroValue, bool)

GetValue takes ValueOrContainer and returns the LoroValue if it is a value.

func ValueAsList added in v0.4.0

func ValueAsList(value LoroValue) ([]LoroValue, bool)

ValueAsList returns the list contents of a LoroValue if it holds a list.

type LoroValueBinary

type LoroValueBinary struct {
	Value []byte
}

func (LoroValueBinary) Destroy

func (e LoroValueBinary) Destroy()

func (LoroValueBinary) String added in v0.4.0

func (e LoroValueBinary) String() string

type LoroValueBool

type LoroValueBool struct {
	Value bool
}

func (LoroValueBool) Destroy

func (e LoroValueBool) Destroy()

func (LoroValueBool) String added in v0.4.0

func (e LoroValueBool) String() string

type LoroValueContainer

type LoroValueContainer struct {
	Value ContainerId
}

func (LoroValueContainer) Destroy

func (e LoroValueContainer) Destroy()

func (LoroValueContainer) String added in v0.4.0

func (e LoroValueContainer) String() string

type LoroValueDouble

type LoroValueDouble struct {
	Value float64
}

func (LoroValueDouble) Destroy

func (e LoroValueDouble) Destroy()

func (LoroValueDouble) String added in v0.4.0

func (e LoroValueDouble) String() string

type LoroValueI64

type LoroValueI64 struct {
	Value int64
}

func (LoroValueI64) Destroy

func (e LoroValueI64) Destroy()

func (LoroValueI64) String added in v0.4.0

func (e LoroValueI64) String() string

type LoroValueLike

type LoroValueLike interface {
	AsLoroValue() LoroValue
}

func AsBinaryValue added in v0.4.0

func AsBinaryValue(v []byte) LoroValueLike

AsBinaryValue converts a byte slice to a LoroValueLike which can be used in most places that expect a value.

func AsBoolValue

func AsBoolValue(v bool) LoroValueLike

AsBoolValue converts a bool to a LoroValueLike which can be used in most places that expect a value.

func AsFloat64Value

func AsFloat64Value(v float64) LoroValueLike

AsFloat64Value converts a float64 to a LoroValueLike which can be used in most places that expect a value.

func AsInt64Value

func AsInt64Value(v int64) LoroValueLike

AsInt64Value converts an int64 to a LoroValueLike which can be used in most places that expect a value.

func AsListValue

func AsListValue(v []LoroValueLike) LoroValueLike

AsListValue converts a list of LoroValueLike to a LoroValueLike which can be used in most places that expect a value.

func AsListValueFromAny

func AsListValueFromAny(v []any) (LoroValueLike, error)

AsListValueFromAny converts a vector of any to a LoroValueLike which can be used in most places that expect a value.

func AsListValueFromValue

func AsListValueFromValue(v []LoroValue) LoroValueLike

AsListValueFromValue converts a vector of LoroValue to a LoroValueLike which can be used in most places that expect a value.

func AsMapValue

func AsMapValue(v map[string]LoroValueLike) LoroValueLike

AsMapValue converts a map of string to LoroValueLike to a LoroValueLike which can be used in most places that expect a value.

func AsMapValueFromAny

func AsMapValueFromAny(v map[string]any) (LoroValueLike, error)

AsMapValueFromAny converts a map of string to any to a LoroValueLike which can be used in most places that expect a value.

func AsMapValueFromValue

func AsMapValueFromValue(v map[string]LoroValue) LoroValueLike

AsMapValueFromValue converts a map of string to LoroValue to a LoroValueLike which can be used in most places that expect a value.

func AsNilValue

func AsNilValue() LoroValueLike

AsNilValue converts a null value to a LoroValueLike which can be used in most places that expect a value.

func AsStringValue

func AsStringValue(v string) LoroValueLike

AsStringValue converts a string to a LoroValueLike which can be used in most places that expect a value.

func AsValue

func AsValue(v any) (LoroValueLike, error)

AsValue converts an any to a LoroValueLike which can be used in most places that expect a value.

func LiftFromExternalLoroValueLike added in v0.3.0

func LiftFromExternalLoroValueLike(handle uint64) LoroValueLike

type LoroValueLikeImpl

type LoroValueLikeImpl struct {
	// contains filtered or unexported fields
}

func (*LoroValueLikeImpl) AsLoroValue

func (_self *LoroValueLikeImpl) AsLoroValue() LoroValue

func (*LoroValueLikeImpl) Destroy

func (object *LoroValueLikeImpl) Destroy()

type LoroValueList

type LoroValueList struct {
	Value []LoroValue
}

func (LoroValueList) Destroy

func (e LoroValueList) Destroy()

func (LoroValueList) String added in v0.4.0

func (e LoroValueList) String() string

type LoroValueMap

type LoroValueMap struct {
	Value map[string]LoroValue
}

func (LoroValueMap) Destroy

func (e LoroValueMap) Destroy()

func (LoroValueMap) String added in v0.4.0

func (e LoroValueMap) String() string

type LoroValueNull

type LoroValueNull struct {
}

func (LoroValueNull) Destroy

func (e LoroValueNull) Destroy()

func (LoroValueNull) String added in v0.4.0

func (LoroValueNull) String() string

type LoroValueString

type LoroValueString struct {
	Value string
}

func (LoroValueString) Destroy

func (e LoroValueString) Destroy()

func (LoroValueString) String added in v0.4.0

func (e LoroValueString) String() string

type MapDelta

type MapDelta struct {
	Updated map[string]**ValueOrContainer
}

func (*MapDelta) Destroy

func (r *MapDelta) Destroy()

type NativeError

type NativeError interface {
	AsError() error
}

type OnPop

type OnPop interface {
	OnPop(undoOrRedo UndoOrRedo, span CounterSpan, undoMeta UndoItemMeta)
}

func AsOnPop added in v0.4.0

func AsOnPop(fn OnPopFn) OnPop

AsOnPop adapts a function to the OnPop interface.

func LiftFromExternalOnPop added in v0.3.0

func LiftFromExternalOnPop(handle uint64) OnPop

type OnPopFn added in v0.4.0

type OnPopFn func(undoOrRedo UndoOrRedo, span CounterSpan, undoMeta UndoItemMeta)

OnPopFn adapts a function to the OnPop interface.

Use with UndoManager.SetOnPop to be notified when an item is popped from the undo or redo stack (i.e. when an undo or redo is performed). The callback receives the metadata that was attached when the item was pushed.

pop := loro.OnPopFn(func(
	undoOrRedo loro.UndoOrRedo,
	span loro.CounterSpan,
	undoMeta loro.UndoItemMeta,
) {
	// restore cursor position from the saved metadata
	restoreCursors(undoMeta.CursorsPos)
})
undoManager.SetOnPop(&pop)

func (OnPopFn) OnPop added in v0.4.0

func (fn OnPopFn) OnPop(undoOrRedo UndoOrRedo, span CounterSpan, undoMeta UndoItemMeta)

type OnPopImpl

type OnPopImpl struct {
	// contains filtered or unexported fields
}

func (*OnPopImpl) Destroy

func (object *OnPopImpl) Destroy()

func (*OnPopImpl) OnPop

func (_self *OnPopImpl) OnPop(undoOrRedo UndoOrRedo, span CounterSpan, undoMeta UndoItemMeta)

type OnPush

type OnPush interface {
	OnPush(undoOrRedo UndoOrRedo, span CounterSpan, diffEvent *DiffEvent) UndoItemMeta
}

func AsOnPush added in v0.4.0

func AsOnPush(fn OnPushFn) OnPush

AsOnPush adapts a function to the OnPush interface.

func LiftFromExternalOnPush added in v0.3.0

func LiftFromExternalOnPush(handle uint64) OnPush

type OnPushFn added in v0.4.0

type OnPushFn func(undoOrRedo UndoOrRedo, span CounterSpan, diffEvent *DiffEvent) UndoItemMeta

OnPushFn adapts a function to the OnPush interface.

Use with UndoManager.SetOnPush to be notified when a new item is pushed onto the undo or redo stack. Return UndoItemMeta to attach custom metadata (e.g. cursor position) that will be available when the item is later popped.

push := loro.OnPushFn(func(
	undoOrRedo loro.UndoOrRedo,
	span loro.CounterSpan,
	diffEvent *loro.DiffEvent,
) loro.UndoItemMeta {
	return loro.UndoItemMeta{CursorsPos: cursorMap}
})
undoManager.SetOnPush(&push)

func (OnPushFn) OnPush added in v0.4.0

func (fn OnPushFn) OnPush(undoOrRedo UndoOrRedo, span CounterSpan, diffEvent *DiffEvent) UndoItemMeta

type OnPushImpl

type OnPushImpl struct {
	// contains filtered or unexported fields
}

func (*OnPushImpl) Destroy

func (object *OnPushImpl) Destroy()

func (*OnPushImpl) OnPush

func (_self *OnPushImpl) OnPush(undoOrRedo UndoOrRedo, span CounterSpan, diffEvent *DiffEvent) UndoItemMeta

type Ordering

type Ordering uint
const (
	OrderingLess    Ordering = 1
	OrderingEqual   Ordering = 2
	OrderingGreater Ordering = 3
)

func (Ordering) String added in v0.4.0

func (o Ordering) String() string

type PathItem

type PathItem struct {
	Container ContainerId
	Index     Index
}

func (*PathItem) Destroy

func (r *PathItem) Destroy()

type PeerInfo

type PeerInfo struct {
	State     LoroValue
	Counter   int32
	Timestamp int64
}

func (*PeerInfo) Destroy

func (r *PeerInfo) Destroy()

type PosQueryResult

type PosQueryResult struct {
	Update  **Cursor
	Current AbsolutePosition
}

func (*PosQueryResult) Destroy

func (r *PosQueryResult) Destroy()

type PosType added in v0.2.0

type PosType uint
const (
	PosTypeBytes   PosType = 1
	PosTypeUnicode PosType = 2
	PosTypeUtf16   PosType = 3
	PosTypeEvent   PosType = 4
	PosTypeEntity  PosType = 5
)

func (PosType) String added in v0.4.0

func (p PosType) String() string

type PreCommitCallback

type PreCommitCallback interface {
	OnPreCommit(payload PreCommitCallbackPayload)
}

func AsPreCommitCallback

func AsPreCommitCallback(fn PreCommitCallbackFn) PreCommitCallback

AsPreCommitCallback adapts a function to the PreCommitCallback interface.

func LiftFromExternalPreCommitCallback added in v0.3.0

func LiftFromExternalPreCommitCallback(handle uint64) PreCommitCallback

type PreCommitCallbackFn

type PreCommitCallbackFn func(payload PreCommitCallbackPayload)

PreCommitCallbackFn adapts a function to the PreCommitCallback interface.

Use with LoroDoc.SubscribePreCommit to intercept commits before they are finalized. The callback receives a payload with change metadata and a ChangeModifier that lets you set a commit message or timestamp.

sub := doc.SubscribePreCommit(loro.PreCommitCallbackFn(
	func(payload loro.PreCommitCallbackPayload) {
		payload.Modifier.SetMessage("auto-tagged commit")
	},
))
defer sub.Unsubscribe()

func (PreCommitCallbackFn) OnPreCommit

func (fn PreCommitCallbackFn) OnPreCommit(payload PreCommitCallbackPayload)

type PreCommitCallbackImpl

type PreCommitCallbackImpl struct {
	// contains filtered or unexported fields
}

func (*PreCommitCallbackImpl) Destroy

func (object *PreCommitCallbackImpl) Destroy()

func (*PreCommitCallbackImpl) OnPreCommit

func (_self *PreCommitCallbackImpl) OnPreCommit(payload PreCommitCallbackPayload)

type PreCommitCallbackPayload

type PreCommitCallbackPayload struct {
	ChangeMeta ChangeMeta
	Origin     string
	Modifier   *ChangeModifier
}

func (*PreCommitCallbackPayload) Destroy

func (r *PreCommitCallbackPayload) Destroy()

type RustBufferI

type RustBufferI interface {
	AsReader() *bytes.Reader
	Free()
	ToGoBytes() []byte
	Data() unsafe.Pointer
	Len() uint64
	Capacity() uint64
}

type Side

type Side uint
const (
	SideLeft   Side = 1
	SideMiddle Side = 2
	SideRight  Side = 3
)

func (Side) String added in v0.4.0

func (s Side) String() string

type StringContainerId

type StringContainerId string

StringContainerId is a string that can be used to get maps, lists, etc from a document.

func AsContainerId

func AsContainerId(v string) StringContainerId

AsContainerId converts a string to a ContainerIDLike, which can be used to get maps, lists, etc from a document.

func (StringContainerId) AsContainerId

func (c StringContainerId) AsContainerId(containerType ContainerType) ContainerId

type StyleConfig

type StyleConfig struct {
	Expand ExpandType
}

func (*StyleConfig) Destroy

func (r *StyleConfig) Destroy()

type StyleConfigMap

type StyleConfigMap struct {
	// contains filtered or unexported fields
}

func LiftFromExternalStyleConfigMap added in v0.3.0

func LiftFromExternalStyleConfigMap(handle uint64) *StyleConfigMap

func NewStyleConfigMap

func NewStyleConfigMap() *StyleConfigMap

func StyleConfigMapDefaultRichTextConfig

func StyleConfigMapDefaultRichTextConfig() *StyleConfigMap

func (*StyleConfigMap) Destroy

func (object *StyleConfigMap) Destroy()

func (*StyleConfigMap) Get

func (_self *StyleConfigMap) Get(key string) *StyleConfig

func (*StyleConfigMap) Insert

func (_self *StyleConfigMap) Insert(key string, value StyleConfig)

type StyleConfigMapInterface

type StyleConfigMapInterface interface {
	Get(key string) *StyleConfig
	Insert(key string, value StyleConfig)
}

type Subscriber

type Subscriber interface {
	OnDiff(diff DiffEvent)
}

func AsSubscriber

func AsSubscriber(fn SubscriberFn) Subscriber

AsSubscriber adapts a function to the Subscriber interface.

func LiftFromExternalSubscriber added in v0.3.0

func LiftFromExternalSubscriber(handle uint64) Subscriber

type SubscriberFn

type SubscriberFn func(diff DiffEvent)

SubscriberFn adapts a function to the Subscriber interface.

Use with LoroDoc.Subscribe, LoroDoc.SubscribeRoot, or any container's Subscribe method (LoroMap, LoroList, LoroText, etc.) to observe document or container changes.

sub := doc.SubscribeRoot(loro.SubscriberFn(func(diff loro.DiffEvent) {
	fmt.Println("changed by:", diff.TriggeredBy)
	for _, event := range diff.Events {
		fmt.Println("container:", event.CurrentTarget)
	}
}))
defer sub.Unsubscribe()

func (SubscriberFn) OnDiff

func (fn SubscriberFn) OnDiff(diff DiffEvent)

type SubscriberImpl

type SubscriberImpl struct {
	// contains filtered or unexported fields
}

func (*SubscriberImpl) Destroy

func (object *SubscriberImpl) Destroy()

func (*SubscriberImpl) OnDiff

func (_self *SubscriberImpl) OnDiff(diff DiffEvent)

type Subscription

type Subscription struct {
	// contains filtered or unexported fields
}

A handle to a subscription created by GPUI. When dropped, the subscription is cancelled and the callback will no longer be invoked.

func LiftFromExternalSubscription added in v0.3.0

func LiftFromExternalSubscription(handle uint64) *Subscription

func (*Subscription) Destroy

func (object *Subscription) Destroy()

func (*Subscription) Detach

func (_self *Subscription) Detach()

Detaches the subscription from this handle. The callback will continue to be invoked until the views or models it has been subscribed to are dropped

func (*Subscription) Unsubscribe

func (_self *Subscription) Unsubscribe()

Unsubscribes the subscription.

type SubscriptionInterface

type SubscriptionInterface interface {
	// Detaches the subscription from this handle. The callback will
	// continue to be invoked until the views or models it has been
	// subscribed to are dropped
	Detach()
	// Unsubscribes the subscription.
	Unsubscribe()
}

A handle to a subscription created by GPUI. When dropped, the subscription is cancelled and the callback will no longer be invoked.

type TextDelta

type TextDelta interface {
	Destroy()
}

type TextDeltaDelete

type TextDeltaDelete struct {
	Delete uint32
}

func (TextDeltaDelete) Destroy

func (e TextDeltaDelete) Destroy()

func (TextDeltaDelete) String added in v0.4.0

func (e TextDeltaDelete) String() string

type TextDeltaInsert

type TextDeltaInsert struct {
	Insert     string
	Attributes *map[string]LoroValue
}

func (TextDeltaInsert) Destroy

func (e TextDeltaInsert) Destroy()

func (TextDeltaInsert) String added in v0.4.0

func (e TextDeltaInsert) String() string

type TextDeltaRetain

type TextDeltaRetain struct {
	Retain     uint32
	Attributes *map[string]LoroValue
}

func (TextDeltaRetain) Destroy

func (e TextDeltaRetain) Destroy()

func (TextDeltaRetain) String added in v0.4.0

func (e TextDeltaRetain) String() string

type TreeDiff

type TreeDiff struct {
	Diff []TreeDiffItem
}

func (*TreeDiff) Destroy

func (r *TreeDiff) Destroy()

type TreeDiffItem

type TreeDiffItem struct {
	Target TreeId
	Action TreeExternalDiff
}

func (*TreeDiffItem) Destroy

func (r *TreeDiffItem) Destroy()

type TreeExternalDiff

type TreeExternalDiff interface {
	Destroy()
}

type TreeExternalDiffCreate

type TreeExternalDiffCreate struct {
	Parent          TreeParentId
	Index           uint32
	FractionalIndex string
}

func (TreeExternalDiffCreate) Destroy

func (e TreeExternalDiffCreate) Destroy()

func (TreeExternalDiffCreate) String added in v0.4.0

func (e TreeExternalDiffCreate) String() string

type TreeExternalDiffDelete

type TreeExternalDiffDelete struct {
	OldParent TreeParentId
	OldIndex  uint32
}

func (TreeExternalDiffDelete) Destroy

func (e TreeExternalDiffDelete) Destroy()

func (TreeExternalDiffDelete) String added in v0.4.0

func (e TreeExternalDiffDelete) String() string

type TreeExternalDiffMove

type TreeExternalDiffMove struct {
	Parent          TreeParentId
	Index           uint32
	FractionalIndex string
	OldParent       TreeParentId
	OldIndex        uint32
}

func (TreeExternalDiffMove) Destroy

func (e TreeExternalDiffMove) Destroy()

func (TreeExternalDiffMove) String added in v0.4.0

func (e TreeExternalDiffMove) String() string

type TreeId

type TreeId struct {
	Peer    uint64
	Counter int32
}

func (*TreeId) Destroy

func (r *TreeId) Destroy()

func (TreeId) String added in v0.4.0

func (id TreeId) String() string

type TreeParentId

type TreeParentId interface {
	Destroy()
}
var (
	TreeParentRoot    TreeParentId = TreeParentIdRoot{}
	TreeParentDeleted TreeParentId = TreeParentIdDeleted{}
	TreeParentUnexist TreeParentId = TreeParentIdUnexist{}
)

TreeParentId singletons. Use these instead of the zero-value struct literals (e.g. TreeParentIdRoot{}) when calling tree APIs that take a TreeParentId.

root, err := tree.Create(loro.TreeParentRoot)
child, err := tree.Create(loro.TreeParentNode(root))

TreeParentRoot is the conceptual root of a tree (a node has no parent). It is distinct from TreeRoot(name), which returns a ContainerId for a tree root container in the document.

func TreeParentNode added in v0.4.0

func TreeParentNode(id TreeId) TreeParentId

TreeParentNode returns a TreeParentId that points at the given tree node. It replaces the verbose TreeParentIdNode{Id: id} struct literal.

child, err := tree.Create(loro.TreeParentNode(parent))

type TreeParentIdDeleted

type TreeParentIdDeleted struct {
}

func (TreeParentIdDeleted) Destroy

func (e TreeParentIdDeleted) Destroy()

func (TreeParentIdDeleted) String added in v0.4.0

func (TreeParentIdDeleted) String() string

type TreeParentIdNode

type TreeParentIdNode struct {
	Id TreeId
}

func (TreeParentIdNode) Destroy

func (e TreeParentIdNode) Destroy()

func (TreeParentIdNode) String added in v0.4.0

func (e TreeParentIdNode) String() string

type TreeParentIdRoot

type TreeParentIdRoot struct {
}

func (TreeParentIdRoot) Destroy

func (e TreeParentIdRoot) Destroy()

func (TreeParentIdRoot) String added in v0.4.0

func (TreeParentIdRoot) String() string

type TreeParentIdUnexist

type TreeParentIdUnexist struct {
}

func (TreeParentIdUnexist) Destroy

func (e TreeParentIdUnexist) Destroy()

func (TreeParentIdUnexist) String added in v0.4.0

func (TreeParentIdUnexist) String() string

type UndoItemMeta

type UndoItemMeta struct {
	Value   LoroValue
	Cursors []CursorWithPos
}

func (*UndoItemMeta) Destroy

func (r *UndoItemMeta) Destroy()

type UndoManager

type UndoManager struct {
	// contains filtered or unexported fields
}

func LiftFromExternalUndoManager added in v0.3.0

func LiftFromExternalUndoManager(handle uint64) *UndoManager

func NewUndoManager

func NewUndoManager(doc *LoroDoc) *UndoManager

Create a new UndoManager.

func (*UndoManager) AddExcludeOriginPrefix

func (_self *UndoManager) AddExcludeOriginPrefix(prefix string)

If a local event's origin matches the given prefix, it will not be recorded in the undo stack.

func (*UndoManager) CanRedo

func (_self *UndoManager) CanRedo() bool

Whether the undo manager can redo.

func (*UndoManager) CanUndo

func (_self *UndoManager) CanUndo() bool

Whether the undo manager can undo.

func (*UndoManager) Destroy

func (object *UndoManager) Destroy()

func (*UndoManager) GroupEnd

func (_self *UndoManager) GroupEnd()

Ends the current group, calling UndoManager::undo() after this will undo all changes that occurred during the group.

func (*UndoManager) GroupStart

func (_self *UndoManager) GroupStart() error

Will start a new group of changes, all subsequent changes will be merged into a new item on the undo stack. If we receive remote changes, we determine wether or not they are conflicting. If the remote changes are conflicting we split the undo item and close the group. If there are no conflict in changed container ids we continue the group merge.

func (*UndoManager) Peer

func (_self *UndoManager) Peer() uint64

Get the peer id of the undo manager

func (*UndoManager) RecordNewCheckpoint

func (_self *UndoManager) RecordNewCheckpoint() error

Record a new checkpoint.

func (*UndoManager) Redo

func (_self *UndoManager) Redo() (bool, error)

Redo the last change made by the peer.

func (*UndoManager) RedoCount

func (_self *UndoManager) RedoCount() uint32

How many times the undo manager can redo.

func (*UndoManager) SetMaxUndoSteps

func (_self *UndoManager) SetMaxUndoSteps(size uint32)

Set the maximum number of undo steps. The default value is 100.

func (*UndoManager) SetMergeInterval

func (_self *UndoManager) SetMergeInterval(interval int64)

Set the merge interval in ms. The default value is 0, which means no merge.

func (*UndoManager) SetOnPop

func (_self *UndoManager) SetOnPop(onPop *OnPop)

Set the listener for pop events. The listener will be called when an undo/redo item is popped from the stack.

func (*UndoManager) SetOnPopFn added in v0.4.0

func (um *UndoManager) SetOnPopFn(fn func(undoOrRedo UndoOrRedo, span CounterSpan, undoMeta UndoItemMeta))

SetOnPopFn is a convenience wrapper around UndoManager.SetOnPop that accepts a plain function instead of an OnPop interface.

undoManager.SetOnPopFn(func(
	undoOrRedo loro.UndoOrRedo,
	span loro.CounterSpan,
	undoMeta loro.UndoItemMeta,
) {
	restoreCursors(undoMeta.CursorsPos)
})

func (*UndoManager) SetOnPush

func (_self *UndoManager) SetOnPush(onPush *OnPush)

Set the listener for push events. The listener will be called when a new undo/redo item is pushed into the stack.

func (*UndoManager) SetOnPushFn added in v0.4.0

func (um *UndoManager) SetOnPushFn(fn func(undoOrRedo UndoOrRedo, span CounterSpan, diffEvent *DiffEvent) UndoItemMeta)

SetOnPushFn is a convenience wrapper around UndoManager.SetOnPush that accepts a plain function instead of an OnPush interface.

undoManager.SetOnPushFn(func(
	undoOrRedo loro.UndoOrRedo,
	span loro.CounterSpan,
	diffEvent *loro.DiffEvent,
) loro.UndoItemMeta {
	return loro.UndoItemMeta{CursorsPos: cursorMap}
})

func (*UndoManager) TopRedoMeta

func (_self *UndoManager) TopRedoMeta() *UndoItemMeta

Get the metadata of the top redo stack item, if any.

func (*UndoManager) TopRedoValue

func (_self *UndoManager) TopRedoValue() *LoroValue

Get the value associated with the top redo stack item, if any.

func (*UndoManager) TopUndoMeta

func (_self *UndoManager) TopUndoMeta() *UndoItemMeta

Get the metadata of the top undo stack item, if any.

func (*UndoManager) TopUndoValue

func (_self *UndoManager) TopUndoValue() *LoroValue

Get the value associated with the top undo stack item, if any.

func (*UndoManager) Undo

func (_self *UndoManager) Undo() (bool, error)

Undo the last change made by the peer.

func (*UndoManager) UndoCount

func (_self *UndoManager) UndoCount() uint32

How many times the undo manager can undo.

type UndoManagerInterface

type UndoManagerInterface interface {
	// If a local event's origin matches the given prefix, it will not be recorded in the
	// undo stack.
	AddExcludeOriginPrefix(prefix string)
	// Whether the undo manager can redo.
	CanRedo() bool
	// Whether the undo manager can undo.
	CanUndo() bool
	// Ends the current group, calling UndoManager::undo() after this will
	// undo all changes that occurred during the group.
	GroupEnd()
	// Will start a new group of changes, all subsequent changes will be merged
	// into a new item on the undo stack. If we receive remote changes, we determine
	// wether or not they are conflicting. If the remote changes are conflicting
	// we split the undo item and close the group. If there are no conflict
	// in changed container ids we continue the group merge.
	GroupStart() error
	// Get the peer id of the undo manager
	Peer() uint64
	// Record a new checkpoint.
	RecordNewCheckpoint() error
	// Redo the last change made by the peer.
	Redo() (bool, error)
	// How many times the undo manager can redo.
	RedoCount() uint32
	// Set the maximum number of undo steps. The default value is 100.
	SetMaxUndoSteps(size uint32)
	// Set the merge interval in ms. The default value is 0, which means no merge.
	SetMergeInterval(interval int64)
	// Set the listener for pop events.
	// The listener will be called when an undo/redo item is popped from the stack.
	SetOnPop(onPop *OnPop)
	// Set the listener for push events.
	// The listener will be called when a new undo/redo item is pushed into the stack.
	SetOnPush(onPush *OnPush)
	// Get the metadata of the top redo stack item, if any.
	TopRedoMeta() *UndoItemMeta
	// Get the value associated with the top redo stack item, if any.
	TopRedoValue() *LoroValue
	// Get the metadata of the top undo stack item, if any.
	TopUndoMeta() *UndoItemMeta
	// Get the value associated with the top undo stack item, if any.
	TopUndoValue() *LoroValue
	// Undo the last change made by the peer.
	Undo() (bool, error)
	// How many times the undo manager can undo.
	UndoCount() uint32
}

type UndoOrRedo

type UndoOrRedo uint
const (
	UndoOrRedoUndo UndoOrRedo = 1
	UndoOrRedoRedo UndoOrRedo = 2
)

func (UndoOrRedo) String added in v0.4.0

func (u UndoOrRedo) String() string

type Unsubscriber

type Unsubscriber interface {
	OnUnsubscribe()
}

func LiftFromExternalUnsubscriber added in v0.3.0

func LiftFromExternalUnsubscriber(handle uint64) Unsubscriber

type UnsubscriberImpl

type UnsubscriberImpl struct {
	// contains filtered or unexported fields
}

func (*UnsubscriberImpl) Destroy

func (object *UnsubscriberImpl) Destroy()

func (*UnsubscriberImpl) OnUnsubscribe

func (_self *UnsubscriberImpl) OnUnsubscribe()

type UpdateOptions

type UpdateOptions struct {
	TimeoutMs      *float64
	UseRefinedDiff bool
}

func (*UpdateOptions) Destroy

func (r *UpdateOptions) Destroy()

type UpdateTimeoutError

type UpdateTimeoutError struct {
	// contains filtered or unexported fields
}

func NewUpdateTimeoutErrorTimeout

func NewUpdateTimeoutErrorTimeout() *UpdateTimeoutError

func (*UpdateTimeoutError) AsError

func (err *UpdateTimeoutError) AsError() error

Convenience method to turn *UpdateTimeoutError into error Avoiding treating nil pointer as non nil error interface

func (UpdateTimeoutError) Error

func (err UpdateTimeoutError) Error() string

func (UpdateTimeoutError) Unwrap

func (err UpdateTimeoutError) Unwrap() error

type UpdateTimeoutErrorTimeout

type UpdateTimeoutErrorTimeout struct {
	// contains filtered or unexported fields
}

Variant structs

func (UpdateTimeoutErrorTimeout) Error

func (err UpdateTimeoutErrorTimeout) Error() string

func (UpdateTimeoutErrorTimeout) Is

func (self UpdateTimeoutErrorTimeout) Is(target error) bool

type ValueOrContainer

type ValueOrContainer struct {
	// contains filtered or unexported fields
}

func LiftFromExternalValueOrContainer added in v0.3.0

func LiftFromExternalValueOrContainer(handle uint64) *ValueOrContainer

func (*ValueOrContainer) AsContainer

func (_self *ValueOrContainer) AsContainer() *ContainerId

func (*ValueOrContainer) AsLoroCounter

func (_self *ValueOrContainer) AsLoroCounter() **LoroCounter

func (*ValueOrContainer) AsLoroList

func (_self *ValueOrContainer) AsLoroList() **LoroList

func (*ValueOrContainer) AsLoroMap

func (_self *ValueOrContainer) AsLoroMap() **LoroMap

func (*ValueOrContainer) AsLoroMovableList

func (_self *ValueOrContainer) AsLoroMovableList() **LoroMovableList

func (*ValueOrContainer) AsLoroText

func (_self *ValueOrContainer) AsLoroText() **LoroText

func (*ValueOrContainer) AsLoroTree

func (_self *ValueOrContainer) AsLoroTree() **LoroTree

func (*ValueOrContainer) AsLoroUnknown

func (_self *ValueOrContainer) AsLoroUnknown() **LoroUnknown

func (*ValueOrContainer) AsValue

func (_self *ValueOrContainer) AsValue() *LoroValue

func (*ValueOrContainer) ContainerType

func (_self *ValueOrContainer) ContainerType() *ContainerType

func (*ValueOrContainer) Destroy

func (object *ValueOrContainer) Destroy()

func (*ValueOrContainer) IsContainer

func (_self *ValueOrContainer) IsContainer() bool

func (*ValueOrContainer) IsValue

func (_self *ValueOrContainer) IsValue() bool

type ValueOrContainerInterface

type ValueOrContainerInterface interface {
	AsContainer() *ContainerId
	AsLoroCounter() **LoroCounter
	AsLoroList() **LoroList
	AsLoroMap() **LoroMap
	AsLoroMovableList() **LoroMovableList
	AsLoroText() **LoroText
	AsLoroTree() **LoroTree
	AsLoroUnknown() **LoroUnknown
	AsValue() *LoroValue
	ContainerType() *ContainerType
	IsContainer() bool
	IsValue() bool
}

type VersionRange

type VersionRange struct {
	// contains filtered or unexported fields
}

func LiftFromExternalVersionRange added in v0.3.0

func LiftFromExternalVersionRange(handle uint64) *VersionRange

func NewVersionRange

func NewVersionRange() *VersionRange

func VersionRangeFromVv

func VersionRangeFromVv(vv *VersionVector) *VersionRange

Create a VersionRange from a VersionVector

func (*VersionRange) Clear

func (_self *VersionRange) Clear()

Clear all ranges in the VersionRange

func (*VersionRange) ContainsId

func (_self *VersionRange) ContainsId(id Id) bool

Check if this VersionRange contains a specific ID

func (*VersionRange) ContainsIdSpan

func (_self *VersionRange) ContainsIdSpan(span IdSpan) bool

Check if this VersionRange contains a specific ID span

func (*VersionRange) ContainsOpsBetween

func (_self *VersionRange) ContainsOpsBetween(vvA *VersionVector, vvB *VersionVector) bool

Check if this VersionRange contains operations between two VersionVectors

func (*VersionRange) Destroy

func (object *VersionRange) Destroy()

func (*VersionRange) ExtendsToIncludeIdSpan

func (_self *VersionRange) ExtendsToIncludeIdSpan(span IdSpan)

Extend this VersionRange to include the given ID span

func (*VersionRange) Get

func (_self *VersionRange) Get(peer uint64) *CounterSpan

Get the counter range for a specific peer Returns the counter range if the peer exists, null otherwise

func (*VersionRange) GetAllRanges

func (_self *VersionRange) GetAllRanges() []VersionRangeItem

Get all ranges as a list of (peer, start, end) tuples

func (*VersionRange) GetPeers

func (_self *VersionRange) GetPeers() []uint64

Get all peer IDs in this VersionRange

func (*VersionRange) HasOverlapWith

func (_self *VersionRange) HasOverlapWith(span IdSpan) bool

Check if this VersionRange has overlap with the given ID span

func (*VersionRange) Insert

func (_self *VersionRange) Insert(peer uint64, start int32, end int32)

Insert a counter range for a specific peer

func (*VersionRange) IsEmpty

func (_self *VersionRange) IsEmpty() bool

Check if the VersionRange is empty

type VersionRangeInterface

type VersionRangeInterface interface {
	// Clear all ranges in the VersionRange
	Clear()
	// Check if this VersionRange contains a specific ID
	ContainsId(id Id) bool
	// Check if this VersionRange contains a specific ID span
	ContainsIdSpan(span IdSpan) bool
	// Check if this VersionRange contains operations between two VersionVectors
	ContainsOpsBetween(vvA *VersionVector, vvB *VersionVector) bool
	// Extend this VersionRange to include the given ID span
	ExtendsToIncludeIdSpan(span IdSpan)
	// Get the counter range for a specific peer
	// Returns the counter range if the peer exists, null otherwise
	Get(peer uint64) *CounterSpan
	// Get all ranges as a list of (peer, start, end) tuples
	GetAllRanges() []VersionRangeItem
	// Get all peer IDs in this VersionRange
	GetPeers() []uint64
	// Check if this VersionRange has overlap with the given ID span
	HasOverlapWith(span IdSpan) bool
	// Insert a counter range for a specific peer
	Insert(peer uint64, start int32, end int32)
	// Check if the VersionRange is empty
	IsEmpty() bool
}

type VersionRangeItem

type VersionRangeItem struct {
	Peer  uint64
	Start int32
	End   int32
}

func (*VersionRangeItem) Destroy

func (r *VersionRangeItem) Destroy()

type VersionVector

type VersionVector struct {
	// contains filtered or unexported fields
}

func LiftFromExternalVersionVector added in v0.3.0

func LiftFromExternalVersionVector(handle uint64) *VersionVector

func NewVersionVector

func NewVersionVector() *VersionVector

func VersionVectorDecode

func VersionVectorDecode(bytes []byte) (*VersionVector, error)

func (*VersionVector) Destroy

func (object *VersionVector) Destroy()

func (*VersionVector) Diff

func (_self *VersionVector) Diff(rhs *VersionVector) VersionVectorDiff

func (*VersionVector) Encode

func (_self *VersionVector) Encode() []byte

func (*VersionVector) Eq

func (_self *VersionVector) Eq(other *VersionVector) bool

func (*VersionVector) ExtendToIncludeVv

func (_self *VersionVector) ExtendToIncludeVv(other *VersionVector)

func (*VersionVector) GetLast

func (_self *VersionVector) GetLast(peer uint64) *int32

func (*VersionVector) GetMissingSpan

func (_self *VersionVector) GetMissingSpan(target *VersionVector) []IdSpan

func (*VersionVector) IncludesId

func (_self *VersionVector) IncludesId(id Id) bool

func (*VersionVector) IncludesVv

func (_self *VersionVector) IncludesVv(other *VersionVector) bool

func (*VersionVector) IntersectSpan

func (_self *VersionVector) IntersectSpan(target IdSpan) *CounterSpan

func (*VersionVector) Merge

func (_self *VersionVector) Merge(other *VersionVector)

func (*VersionVector) PartialCmp

func (_self *VersionVector) PartialCmp(other *VersionVector) *Ordering

func (*VersionVector) SetEnd

func (_self *VersionVector) SetEnd(id Id)

func (*VersionVector) SetLast

func (_self *VersionVector) SetLast(id Id)

func (*VersionVector) String added in v0.4.0

func (v *VersionVector) String() string

func (*VersionVector) ToHashmap

func (_self *VersionVector) ToHashmap() map[uint64]int32

func (*VersionVector) TryUpdateLast

func (_self *VersionVector) TryUpdateLast(id Id) bool

Update the end counter of the given client if the end is greater. Return whether updated

type VersionVectorDiff

type VersionVectorDiff struct {
	// need to add these spans to move from right to left
	Retreat map[uint64]CounterSpan
	// need to add these spans to move from left to right
	Forward map[uint64]CounterSpan
}

func (*VersionVectorDiff) Destroy

func (r *VersionVectorDiff) Destroy()

type VersionVectorInterface

type VersionVectorInterface interface {
	Diff(rhs *VersionVector) VersionVectorDiff
	Encode() []byte
	Eq(other *VersionVector) bool
	ExtendToIncludeVv(other *VersionVector)
	GetLast(peer uint64) *int32
	GetMissingSpan(target *VersionVector) []IdSpan
	IncludesId(id Id) bool
	IncludesVv(other *VersionVector) bool
	IntersectSpan(target IdSpan) *CounterSpan
	Merge(other *VersionVector)
	PartialCmp(other *VersionVector) *Ordering
	SetEnd(id Id)
	SetLast(id Id)
	ToHashmap() map[uint64]int32
	// Update the end counter of the given client if the end is greater. Return whether updated
	TryUpdateLast(id Id) bool
}

Directories

Path Synopsis
examples
simple command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL