Struct yrs::YEventChange
source · [−]Expand description
A data type representing a single change detected over an observed shared collection. A type
of change can be detected using a tag field:
Y_EVENT_CHANGE_ADDmarks a new elements added to a collection. In this casevaluesfield contains a pointer to a list of newly inserted values, whilelenfield informs about their count.Y_EVENT_CHANGE_DELETEmarks an existing elements removed from the collection. In this caselenfield informs about number of removed elements.Y_EVENT_CHANGE_RETAINmarks a number of elements that have not been changed, counted from the previous element.lenfield informs about number of retained elements.
A list of changes returned by yarray_event_delta/yxml_event_delta enables to locate a
position of all changes within an observed collection by using a combination of added/deleted
change structs separated by retained changes (marking eg. number of elements that can be safely
skipped, since they remained unchanged).
Fields
tag: c_charTag field used to identify particular type of change made:
Y_EVENT_CHANGE_ADDmarks a new elements added to a collection. In this casevaluesfield contains a pointer to a list of newly inserted values, whilelenfield informs about their count.Y_EVENT_CHANGE_DELETEmarks an existing elements removed from the collection. In this caselenfield informs about number of removed elements.Y_EVENT_CHANGE_RETAINmarks a number of elements that have not been changed, counted from the previous element.lenfield informs about number of retained elements.
len: c_intNumber of element affected by current type of a change. It can refer to a number of
inserted values, number of deleted element or a number of retained (unchanged) values.
values: *const YOutputUsed in case when current change is of Y_EVENT_CHANGE_ADD type. Contains a list (of
length stored in len field) of newly inserted values.
Trait Implementations
sourceimpl Drop for YEventChange
impl Drop for YEventChange
Auto Trait Implementations
impl !RefUnwindSafe for YEventChange
impl !Send for YEventChange
impl !Sync for YEventChange
impl Unpin for YEventChange
impl !UnwindSafe for YEventChange
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more