Struct automerge_wasm::Automerge
source · pub struct Automerge { /* private fields */ }
Implementations§
source§impl Automerge
impl Automerge
pub fn new(
actor: Option<String>,
text_rep: TextRepresentation
) -> Result<Automerge, BadActorId>
pub fn clone(&mut self, actor: Option<String>) -> Result<Automerge, BadActorId>
pub fn fork(
&mut self,
actor: Option<String>,
heads: JsValue
) -> Result<Automerge, Fork>
pub fn pending_ops(&self) -> JsValue
pub fn commit(&mut self, message: Option<String>, time: Option<f64>) -> JsValue
pub fn merge(&mut self, other: &mut Automerge) -> Result<Array, Merge>
pub fn rollback(&mut self) -> f64
pub fn keys(&self, obj: JsValue, heads: Option<Array>) -> Result<Array, Get>
pub fn text(&self, obj: JsValue, heads: Option<Array>) -> Result<String, Get>
pub fn splice(
&mut self,
obj: JsValue,
start: f64,
delete_count: f64,
text: JsValue
) -> Result<(), Splice>
pub fn push(
&mut self,
obj: JsValue,
value: JsValue,
datatype: JsValue
) -> Result<(), Insert>
pub fn push_object(
&mut self,
obj: JsValue,
value: JsValue
) -> Result<Option<String>, InsertObject>
pub fn insert(
&mut self,
obj: JsValue,
index: f64,
value: JsValue,
datatype: JsValue
) -> Result<(), Insert>
pub fn insert_object(
&mut self,
obj: JsValue,
index: f64,
value: JsValue
) -> Result<Option<String>, InsertObject>
pub fn put(
&mut self,
obj: JsValue,
prop: JsValue,
value: JsValue,
datatype: JsValue
) -> Result<(), Insert>
pub fn put_object(
&mut self,
obj: JsValue,
prop: JsValue,
value: JsValue
) -> Result<JsValue, InsertObject>
pub fn increment(
&mut self,
obj: JsValue,
prop: JsValue,
value: JsValue
) -> Result<(), Increment>
pub fn get(
&self,
obj: JsValue,
prop: JsValue,
heads: Option<Array>
) -> Result<JsValue, Get>
pub fn get_with_type(
&self,
obj: JsValue,
prop: JsValue,
heads: Option<Array>
) -> Result<JsValue, Get>
pub fn get_all(
&self,
obj: JsValue,
arg: JsValue,
heads: Option<Array>
) -> Result<Array, Get>
pub fn enable_freeze(&mut self, enable: JsValue) -> Result<JsValue, JsValue>
pub fn enable_patches(&mut self, enable: JsValue) -> Result<JsValue, JsValue>
pub fn register_datatype(
&mut self,
datatype: JsValue,
function: JsValue
) -> Result<(), InvalidDatatype>
pub fn apply_patches(
&mut self,
object: JsValue,
meta: JsValue,
callback: JsValue
) -> Result<JsValue, ApplyPatch>
pub fn pop_patches(&mut self) -> Result<Array, PopPatches>
pub fn length(&self, obj: JsValue, heads: Option<Array>) -> Result<f64, Get>
pub fn delete(&mut self, obj: JsValue, prop: JsValue) -> Result<(), Get>
pub fn save(&mut self) -> Uint8Array
pub fn save_incremental(&mut self) -> Uint8Array
pub fn load_incremental(&mut self, data: Uint8Array) -> Result<f64, Load>
pub fn apply_changes(
&mut self,
changes: JsValue
) -> Result<(), ApplyChangesError>
pub fn get_changes(&mut self, have_deps: JsValue) -> Result<Array, Get>
pub fn get_change_by_hash(
&mut self,
hash: JsValue
) -> Result<JsValue, BadChangeHash>
pub fn get_changes_added(&mut self, other: &mut Automerge) -> Array
pub fn get_heads(&mut self) -> Array
pub fn get_actor_id(&self) -> String
pub fn get_last_local_change(&mut self) -> JsValue
pub fn dump(&mut self)
pub fn get_missing_deps(&mut self, heads: Option<Array>) -> Result<Array, Get>
pub fn receive_sync_message(
&mut self,
state: &mut SyncState,
message: Uint8Array
) -> Result<(), ReceiveSyncMessage>
pub fn generate_sync_message(&mut self, state: &mut SyncState) -> JsValue
pub fn to_js(&mut self, meta: JsValue) -> Result<JsValue, Export>
pub fn materialize(
&mut self,
obj: JsValue,
heads: Option<Array>,
meta: JsValue
) -> Result<JsValue, Materialize>
pub fn empty_change(
&mut self,
message: Option<String>,
time: Option<f64>
) -> JsValue
Trait Implementations§
source§impl FromWasmAbi for Automerge
impl FromWasmAbi for Automerge
source§impl IntoWasmAbi for Automerge
impl IntoWasmAbi for Automerge
source§impl LongRefFromWasmAbi for Automerge
impl LongRefFromWasmAbi for Automerge
source§impl OptionFromWasmAbi for Automerge
impl OptionFromWasmAbi for Automerge
source§impl OptionIntoWasmAbi for Automerge
impl OptionIntoWasmAbi for Automerge
source§impl RefFromWasmAbi for Automerge
impl RefFromWasmAbi for Automerge
source§impl RefMutFromWasmAbi for Automerge
impl RefMutFromWasmAbi for Automerge
Auto Trait Implementations§
impl RefUnwindSafe for Automerge
impl !Send for Automerge
impl !Sync for Automerge
impl Unpin for Automerge
impl UnwindSafe for Automerge
Blanket Implementations§
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
Same as
IntoWasmAbi::Abi
source§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
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
.