pub struct WeakLink(/* private fields */);
Implementations§
source§impl YWeakLink
impl YWeakLink
sourcepub fn prelim(&self) -> bool
pub fn prelim(&self) -> bool
Returns true if this is a preliminary instance of YWeakLink
.
Preliminary instances can be nested into other shared data types such as YArray
and YMap
.
Once a preliminary instance has been inserted this way, it becomes integrated into ywasm
document store and cannot be nested again: attempt to do so will result in an exception.
pub fn get_type(&self) -> u8
sourcepub fn id(&self) -> Result<JsValue, JsValue>
pub fn id(&self) -> Result<JsValue, JsValue>
Gets unique logical identifier of this type, shared across peers collaborating on the same document.
sourcepub fn alive(&self, txn: &YTransaction) -> bool
pub fn alive(&self, txn: &YTransaction) -> bool
Checks if current YWeakLink reference is alive and has not been deleted by its parent collection. This method only works on already integrated shared types and will return false is current type is preliminary (has not been integrated into document).
pub fn deref(&self, txn: &ImplicitTransaction) -> Result<JsValue, JsValue>
pub fn unquote(&self, txn: &ImplicitTransaction) -> Result<Array, JsValue>
pub fn to_string(&self, txn: &ImplicitTransaction) -> Result<String, JsValue>
sourcepub fn observe(&mut self, callback: Function) -> Result<(), JsValue>
pub fn observe(&mut self, callback: Function) -> Result<(), JsValue>
Subscribes to all operations happening over this instance of YMap
. All changes are
batched and eventually triggered during transaction commit phase.
sourcepub fn unobserve(&mut self, callback: Function) -> Result<bool, JsValue>
pub fn unobserve(&mut self, callback: Function) -> Result<bool, JsValue>
Unsubscribes a callback previously subscribed with observe
method.
Trait Implementations§
source§impl FromWasmAbi for YWeakLink
impl FromWasmAbi for YWeakLink
source§impl IntoWasmAbi for YWeakLink
impl IntoWasmAbi for YWeakLink
source§impl LongRefFromWasmAbi for YWeakLink
impl LongRefFromWasmAbi for YWeakLink
source§impl OptionFromWasmAbi for YWeakLink
impl OptionFromWasmAbi for YWeakLink
source§impl OptionIntoWasmAbi for YWeakLink
impl OptionIntoWasmAbi for YWeakLink
source§impl RefFromWasmAbi for YWeakLink
impl RefFromWasmAbi for YWeakLink
source§impl RefMutFromWasmAbi for YWeakLink
impl RefMutFromWasmAbi for YWeakLink
source§impl TryFromJsValue for YWeakLink
impl TryFromJsValue for YWeakLink
source§impl VectorFromWasmAbi for YWeakLink
impl VectorFromWasmAbi for YWeakLink
source§impl VectorIntoWasmAbi for YWeakLink
impl VectorIntoWasmAbi for YWeakLink
Auto Trait Implementations§
impl Freeze for YWeakLink
impl !RefUnwindSafe for YWeakLink
impl Send for YWeakLink
impl Sync for YWeakLink
impl Unpin for YWeakLink
impl !UnwindSafe for YWeakLink
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
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
IntoWasmAbi::Abi
source§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
IntoWasmAbi::into_abi
, except that it may throw and never
return in the case of Err
.