pub type MutCursor<'a, E, I, const IE: usize, const LE: usize> = SafeCursor<&'a mut ContentTreeRaw<E, I, IE, LE>, E, I, IE, LE>;
Expand description
A mutable cursor into a ContentTree. Mutable cursors inherit all the functionality of Cursor, and can also be used to modify the content tree.
A mutable cursor mutably borrows the content tree. Only one mutable cursor can exist at a time.
Aliased Type§
#[repr(transparent)]pub struct MutCursor<'a, E, I, const IE: usize, const LE: usize> {
pub inner: UnsafeCursor<E, I, IE, LE>,
/* private fields */
}
Fields§
§inner: UnsafeCursor<E, I, IE, LE>
Implementations§
Source§impl<'a, E: ContentTraits, I: TreeMetrics<E>, const IE: usize, const LE: usize> MutCursor<'a, E, I, IE, LE>
impl<'a, E: ContentTraits, I: TreeMetrics<E>, const IE: usize, const LE: usize> MutCursor<'a, E, I, IE, LE>
pub unsafe fn unchecked_from_raw( _tree: &mut Pin<Box<ContentTreeRaw<E, I, IE, LE>>>, cursor: UnsafeCursor<E, I, IE, LE>, ) -> Self
pub fn insert_notify<F>(&mut self, new_entry: E, notify: F)
pub fn insert(&mut self, new_entry: E)
pub fn replace_range_notify<N>(&mut self, new_entry: E, notify: N)
pub fn replace_range(&mut self, new_entry: E)
pub fn delete_notify<F>(&mut self, del_items: usize, notify: F)
pub fn delete(&mut self, del_items: usize)
Sourcepub fn replace_entry(&mut self, items: &[E])
pub fn replace_entry(&mut self, items: &[E])
Replace the current entry with the items passed via items[]. Items.len must be <= 3. The cursor offset is ignored. This is a fancy method - use sparingly.
pub fn replace_entry_simple(&mut self, new_item: E)
Sourcepub fn mutate_single_entry_notify<MapFn, R, N>(
&mut self,
replace_max: usize,
notify: N,
map_fn: MapFn,
) -> (usize, R)
pub fn mutate_single_entry_notify<MapFn, R, N>( &mut self, replace_max: usize, notify: N, map_fn: MapFn, ) -> (usize, R)
Mutate a single entry in-place. The entry to be modified is whatever is at this cursor, and up to replace_max size.
The function will be modified by the (passed) map_fn.
Returns a tuple of (actual length replaced, map_fn return value).
Methods from Deref<Target = Cursor<'a, E, I, IE, LE>>§
pub fn count_pos_raw<Out, F, G, H>( &self, offset_to_num: F, entry_len: G, entry_len_at: H, ) -> Out
pub fn insert_notify<F>(&mut self, new_entry: E, notify: F)
pub fn insert(&mut self, new_entry: E)
pub fn replace_range_notify<N>(&mut self, new_entry: E, notify: N)
pub fn replace_range(&mut self, new_entry: E)
pub fn delete_notify<F>(&mut self, del_items: usize, notify: F)
pub fn delete(&mut self, del_items: usize)
Sourcepub fn replace_entry(&mut self, items: &[E])
pub fn replace_entry(&mut self, items: &[E])
Replace the current entry with the items passed via items[]. Items.len must be <= 3. The cursor offset is ignored. This is a fancy method - use sparingly.
pub fn replace_entry_simple(&mut self, new_item: E)
Sourcepub fn mutate_single_entry_notify<MapFn, R, N>(
&mut self,
replace_max: usize,
notify: N,
map_fn: MapFn,
) -> (usize, R)
pub fn mutate_single_entry_notify<MapFn, R, N>( &mut self, replace_max: usize, notify: N, map_fn: MapFn, ) -> (usize, R)
Mutate a single entry in-place. The entry to be modified is whatever is at this cursor, and up to replace_max size.
The function will be modified by the (passed) map_fn.
Returns a tuple of (actual length replaced, map_fn return value).