pub struct Automerge { /* private fields */ }

Implementations§

source§

impl Automerge

source

pub fn new( actor: Option<String>, text_rep: TextRepresentation ) -> Result<Automerge, BadActorId>

source

pub fn clone(&mut self, actor: Option<String>) -> Result<Automerge, BadActorId>

source

pub fn fork( &mut self, actor: Option<String>, heads: JsValue ) -> Result<Automerge, Fork>

source

pub fn pending_ops(&self) -> JsValue

source

pub fn commit(&mut self, message: Option<String>, time: Option<f64>) -> JsValue

source

pub fn merge(&mut self, other: &mut Automerge) -> Result<Array, Merge>

source

pub fn rollback(&mut self) -> f64

source

pub fn keys(&self, obj: JsValue, heads: Option<Array>) -> Result<Array, Get>

source

pub fn text(&self, obj: JsValue, heads: Option<Array>) -> Result<String, Get>

source

pub fn splice( &mut self, obj: JsValue, start: f64, delete_count: f64, text: JsValue ) -> Result<(), Splice>

source

pub fn push( &mut self, obj: JsValue, value: JsValue, datatype: JsValue ) -> Result<(), Insert>

source

pub fn push_object( &mut self, obj: JsValue, value: JsValue ) -> Result<Option<String>, InsertObject>

source

pub fn insert( &mut self, obj: JsValue, index: f64, value: JsValue, datatype: JsValue ) -> Result<(), Insert>

source

pub fn insert_object( &mut self, obj: JsValue, index: f64, value: JsValue ) -> Result<Option<String>, InsertObject>

source

pub fn put( &mut self, obj: JsValue, prop: JsValue, value: JsValue, datatype: JsValue ) -> Result<(), Insert>

source

pub fn put_object( &mut self, obj: JsValue, prop: JsValue, value: JsValue ) -> Result<JsValue, InsertObject>

source

pub fn increment( &mut self, obj: JsValue, prop: JsValue, value: JsValue ) -> Result<(), Increment>

source

pub fn get( &self, obj: JsValue, prop: JsValue, heads: Option<Array> ) -> Result<JsValue, Get>

source

pub fn get_with_type( &self, obj: JsValue, prop: JsValue, heads: Option<Array> ) -> Result<JsValue, Get>

source

pub fn get_all( &self, obj: JsValue, arg: JsValue, heads: Option<Array> ) -> Result<Array, Get>

source

pub fn enable_freeze(&mut self, enable: JsValue) -> Result<JsValue, JsValue>

source

pub fn register_datatype( &mut self, datatype: JsValue, function: JsValue ) -> Result<(), InvalidDatatype>

source

pub fn apply_patches( &mut self, object: JsValue, meta: JsValue ) -> Result<JsValue, JsValue>

source

pub fn apply_and_return_patches( &mut self, object: JsValue, meta: JsValue ) -> Result<JsValue, JsValue>

source

pub fn diff_incremental(&mut self) -> Result<Array, PopPatches>

source

pub fn update_diff_cursor(&mut self)

source

pub fn reset_diff_cursor(&mut self)

source

pub fn diff(&mut self, before: Array, after: Array) -> Result<Array, Diff>

source

pub fn isolate(&mut self, heads: Array) -> Result<(), Isolate>

source

pub fn integrate(&mut self)

source

pub fn length(&self, obj: JsValue, heads: Option<Array>) -> Result<f64, Get>

source

pub fn delete(&mut self, obj: JsValue, prop: JsValue) -> Result<(), Get>

source

pub fn save(&mut self) -> Uint8Array

source

pub fn save_incremental(&mut self) -> Uint8Array

source

pub fn save_since( &mut self, heads: Array ) -> Result<Uint8Array, BadChangeHashes>

source

pub fn save_nocompress(&mut self) -> Uint8Array

source

pub fn save_and_verify(&mut self) -> Result<Uint8Array, Load>

source

pub fn load_incremental(&mut self, data: Uint8Array) -> Result<f64, Load>

source

pub fn apply_changes( &mut self, changes: JsValue ) -> Result<(), ApplyChangesError>

source

pub fn get_changes(&mut self, have_deps: JsValue) -> Result<Array, Get>

source

pub fn get_change_by_hash( &mut self, hash: JsValue ) -> Result<JsValue, BadChangeHash>

source

pub fn get_changes_added(&mut self, other: &mut Automerge) -> Array

source

pub fn get_heads(&mut self) -> Array

source

pub fn get_actor_id(&self) -> String

source

pub fn get_last_local_change(&mut self) -> JsValue

source

pub fn dump(&mut self)

source

pub fn get_missing_deps(&mut self, heads: Option<Array>) -> Result<Array, Get>

source

pub fn receive_sync_message( &mut self, state: &mut SyncState, message: Uint8Array ) -> Result<(), ReceiveSyncMessage>

source

pub fn generate_sync_message(&mut self, state: &mut SyncState) -> JsValue

source

pub fn to_js(&mut self, meta: JsValue) -> Result<JsValue, Export>

source

pub fn materialize( &mut self, obj: JsValue, heads: Option<Array>, meta: JsValue ) -> Result<JsValue, Materialize>

source

pub fn get_cursor( &mut self, obj: JsValue, index: f64, heads: Option<Array> ) -> Result<String, Cursor>

source

pub fn get_cursor_position( &mut self, obj: JsValue, cursor: JsValue, heads: Option<Array> ) -> Result<f64, Cursor>

source

pub fn empty_change( &mut self, message: Option<String>, time: Option<f64> ) -> JsValue

source

pub fn mark( &mut self, obj: JsValue, range: JsValue, name: JsValue, value: JsValue, datatype: JsValue ) -> Result<(), Mark>

source

pub fn unmark( &mut self, obj: JsValue, range: JsValue, name: JsValue ) -> Result<(), Mark>

source

pub fn marks( &mut self, obj: JsValue, heads: Option<Array> ) -> Result<JsValue, JsValue>

source

pub fn marks_at( &mut self, obj: JsValue, index: f64, heads: Option<Array> ) -> Result<Object, JsValue>

Trait Implementations§

source§

impl Debug for Automerge

source§

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

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

impl From<Automerge> for JsValue

source§

fn from(value: Automerge) -> Self

Converts to this type from the input type.
source§

impl FromWasmAbi for Automerge

§

type Abi = u32

The wasm ABI type that this converts from when coming back out from the ABI boundary.
source§

unsafe fn from_abi(js: u32) -> Self

Recover a Self from Self::Abi. Read more
source§

impl IntoWasmAbi for Automerge

§

type Abi = u32

The wasm ABI type that this converts into when crossing the ABI boundary.
source§

fn into_abi(self) -> u32

Convert self into Self::Abi so that it can be sent across the wasm ABI boundary.
source§

impl LongRefFromWasmAbi for Automerge

§

type Abi = u32

Same as RefFromWasmAbi::Abi
§

type Anchor = Ref<'static, Automerge>

Same as RefFromWasmAbi::Anchor
source§

unsafe fn long_ref_from_abi(js: Self::Abi) -> Self::Anchor

Same as RefFromWasmAbi::ref_from_abi
source§

impl OptionFromWasmAbi for Automerge

source§

fn is_none(abi: &Self::Abi) -> bool

Tests whether the argument is a “none” instance. If so it will be deserialized as None, and otherwise it will be passed to FromWasmAbi.
source§

impl OptionIntoWasmAbi for Automerge

source§

fn none() -> Self::Abi

Returns an ABI instance indicating “none”, which JS will interpret as the None branch of this option. Read more
source§

impl RefFromWasmAbi for Automerge

§

type Abi = u32

The wasm ABI type references to Self are recovered from.
§

type Anchor = Ref<'static, Automerge>

The type that holds the reference to Self for the duration of the invocation of the function that has an &Self parameter. This is required to ensure that the lifetimes don’t persist beyond one function call, and so that they remain anonymous.
source§

unsafe fn ref_from_abi(js: Self::Abi) -> Self::Anchor

Recover a Self::Anchor from Self::Abi. Read more
source§

impl RefMutFromWasmAbi for Automerge

§

type Abi = u32

Same as RefFromWasmAbi::Abi
§

type Anchor = RefMut<'static, Automerge>

Same as RefFromWasmAbi::Anchor
source§

unsafe fn ref_mut_from_abi(js: Self::Abi) -> Self::Anchor

Same as RefFromWasmAbi::ref_from_abi
source§

impl TryFromJsValue for Automerge

§

type Error = JsValue

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

fn try_from_js_value(value: JsValue) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl VectorFromWasmAbi for Automerge

§

type Abi = <Box<[JsValue], Global> as FromWasmAbi>::Abi

source§

unsafe fn vector_from_abi(js: Self::Abi) -> Box<[Automerge]>

source§

impl VectorIntoWasmAbi for Automerge

§

type Abi = <Box<[JsValue], Global> as IntoWasmAbi>::Abi

source§

fn vector_into_abi(vector: Box<[Automerge]>) -> Self::Abi

source§

impl WasmDescribe for Automerge

source§

impl WasmDescribeVector for Automerge

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

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

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

fn in_current_span(self) -> Instrumented<Self>

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

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

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T> ReturnWasmAbi for Twhere T: IntoWasmAbi,

§

type Abi = <T as IntoWasmAbi>::Abi

Same as IntoWasmAbi::Abi
source§

fn return_abi(self) -> <T as ReturnWasmAbi>::Abi

Same as IntoWasmAbi::into_abi, except that it may throw and never return in the case of Err.
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

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

§

type Error = Infallible

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

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

Performs the conversion.
source§

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

§

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

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

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

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

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

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

fn with_current_subscriber(self) -> WithDispatch<Self>

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