Struct yrs::YEventKeyChange

source ·
#[repr(C)]
pub struct YEventKeyChange { pub key: *const c_char, pub tag: c_char, pub old_value: *const YOutput, pub new_value: *const YOutput, }
Expand description

A data type representing a single change made over a map component of shared collection types, such as YMap entries or YXmlText/YXmlElement attributes. A key field provides a corresponding unique key string of a changed entry, while tag field informs about specific type of change being done:

  1. Y_EVENT_KEY_CHANGE_ADD used to identify a newly added entry. In this case an old_value field is NULL, while new_value field contains an inserted value.
  2. Y_EVENT_KEY_CHANGE_DELETE used to identify an existing entry being removed. In this case an old_value field contains the removed value.
  3. Y_EVENT_KEY_CHANGE_UPDATE used to identify an existing entry, which value has been changed. In this case old_value field contains replaced value, while new_value contains a newly inserted one.

Fields§

§key: *const c_char

A UTF8-encoded null-terminated string containing a key of a changed entry.

§tag: c_char

Tag field informing about type of change current struct refers to:

  1. Y_EVENT_KEY_CHANGE_ADD used to identify a newly added entry. In this case an old_value field is NULL, while new_value field contains an inserted value.
  2. Y_EVENT_KEY_CHANGE_DELETE used to identify an existing entry being removed. In this case an old_value field contains the removed value.
  3. Y_EVENT_KEY_CHANGE_UPDATE used to identify an existing entry, which value has been changed. In this case old_value field contains replaced value, while new_value contains a newly inserted one.
§old_value: *const YOutput

Contains a removed entry’s value or replaced value of an updated entry.

§new_value: *const YOutput

Contains a value of newly inserted entry or an updated entry’s new value.

Trait Implementations§

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.