#[repr(C)]pub struct YDeltaIn {
pub tag: u8,
pub len: u32,
pub attributes: *const YInput,
pub insert: *const YInput,
}Expand description
A data type representing a single change to be performed in sequence of changes defined
as parameter to a ytext_insert_delta function. A type of change can be detected using
a tag field:
Y_EVENT_CHANGE_ADDmarks a new characters added to a collection. In this caseinsertfield contains a pointer to a list of newly inserted values, whilelenfield informs about their count. Additionallyattributes_lenandattributescarry information about optional formatting attributes applied to edited blocks.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 characters that have not been changed, counted from the previous element.lenfield informs about number of retained elements. Additionallyattributes_lenandattributescarry information about optional formatting attributes applied to edited blocks.
Fields§
§tag: u8Tag 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: u32Number of element affected by current type of change. It can refer to a number of
inserted values, number of deleted element or a number of retained (unchanged) values.
attributes: *const YInputA nullable pointer to a list of formatting attributes assigned to an edited area represented by this delta.
insert: *const YInputUsed 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.
Auto Trait Implementations§
impl Freeze for YDeltaIn
impl !RefUnwindSafe for YDeltaIn
impl !Send for YDeltaIn
impl !Sync for YDeltaIn
impl Unpin for YDeltaIn
impl !UnwindSafe for YDeltaIn
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
Mutably borrows from an owned value. Read more