#[repr(transparent)]pub struct SafeCursor<R, E: ContentTraits, I: TreeMetrics<E>, const IE: usize = DEFAULT_IE, const LE: usize = DEFAULT_LE> {
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> SafeCursor<&'a ContentTreeRaw<E, I, IE, LE>, E, I, IE, LE>
This file provides the safe implementation methods for cursors.
impl<'a, E: ContentTraits, I: TreeMetrics<E>, const IE: usize, const LE: usize> SafeCursor<&'a ContentTreeRaw<E, I, IE, LE>, E, I, IE, LE>
This file provides the safe implementation methods for cursors.
pub unsafe fn unchecked_from_raw( _tree: &'a ContentTreeRaw<E, I, IE, LE>, cursor: UnsafeCursor<E, I, IE, LE>, ) -> Self
Source§impl<R, E: ContentTraits, I: TreeMetrics<E>, const IE: usize, const LE: usize> SafeCursor<R, E, I, IE, LE>
impl<R, E: ContentTraits, I: TreeMetrics<E>, const IE: usize, const LE: usize> SafeCursor<R, E, I, IE, LE>
Source§impl<'a, E: ContentTraits, I: TreeMetrics<E>, const IE: usize, const LE: usize> SafeCursor<&'a mut ContentTreeRaw<E, I, IE, LE>, E, I, IE, LE>
impl<'a, E: ContentTraits, I: TreeMetrics<E>, const IE: usize, const LE: usize> SafeCursor<&'a mut ContentTreeRaw<E, I, IE, LE>, 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).
Source§impl<R, E: ContentTraits + ContentLength, I: FindContent<E>, const IE: usize, const LE: usize> SafeCursor<R, E, I, IE, LE>
impl<R, E: ContentTraits + ContentLength, I: FindContent<E>, const IE: usize, const LE: usize> SafeCursor<R, E, I, IE, LE>
pub fn count_content_pos(&self) -> usize
Source§impl<R, E: ContentTraits, I: FindOffset<E>, const IE: usize, const LE: usize> SafeCursor<R, E, I, IE, LE>
impl<R, E: ContentTraits, I: FindOffset<E>, const IE: usize, const LE: usize> SafeCursor<R, E, I, IE, LE>
pub fn count_offset_pos(&self) -> usize
Source§impl<R, E: ContentTraits + Searchable, I: TreeMetrics<E>, const IE: usize, const LE: usize> SafeCursor<R, E, I, IE, LE>
impl<R, E: ContentTraits + Searchable, I: TreeMetrics<E>, const IE: usize, const LE: usize> SafeCursor<R, E, I, IE, LE>
Trait Implementations§
Source§impl<R: Clone, E: Clone + ContentTraits, I: Clone + TreeMetrics<E>, const IE: usize, const LE: usize> Clone for SafeCursor<R, E, I, IE, LE>
impl<R: Clone, E: Clone + ContentTraits, I: Clone + TreeMetrics<E>, const IE: usize, const LE: usize> Clone for SafeCursor<R, E, I, IE, LE>
Source§fn clone(&self) -> SafeCursor<R, E, I, IE, LE>
fn clone(&self) -> SafeCursor<R, E, I, IE, LE>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<R: Debug, E: Debug + ContentTraits, I: Debug + TreeMetrics<E>, const IE: usize, const LE: usize> Debug for SafeCursor<R, E, I, IE, LE>
impl<R: Debug, E: Debug + ContentTraits, I: Debug + TreeMetrics<E>, const IE: usize, const LE: usize> Debug for SafeCursor<R, E, I, IE, LE>
Source§impl<R, E: ContentTraits, I: TreeMetrics<E>, const IE: usize, const LE: usize> From<SafeCursor<R, E, I, IE, LE>> for UnsafeCursor<E, I, IE, LE>
impl<R, E: ContentTraits, I: TreeMetrics<E>, const IE: usize, const LE: usize> From<SafeCursor<R, E, I, IE, LE>> for UnsafeCursor<E, I, IE, LE>
Source§fn from(c: SafeCursor<R, E, I, IE, LE>) -> Self
fn from(c: SafeCursor<R, E, I, IE, LE>) -> Self
Converts to this type from the input type.
Source§impl<R, E: ContentTraits + Eq, I: TreeMetrics<E>, const IE: usize, const LE: usize> Ord for SafeCursor<R, E, I, IE, LE>
NOTE: This comparator will panic when cursors from different range trees are compared.
impl<R, E: ContentTraits + Eq, I: TreeMetrics<E>, const IE: usize, const LE: usize> Ord for SafeCursor<R, E, I, IE, LE>
NOTE: This comparator will panic when cursors from different range trees are compared.
Also beware: A cursor pointing to the end of a leaf entry will be considered less than a cursor pointing to the subsequent entry in the next leaf.
Source§impl<R, E: ContentTraits, I: TreeMetrics<E>, const IE: usize, const LE: usize> PartialEq for SafeCursor<R, E, I, IE, LE>
impl<R, E: ContentTraits, I: TreeMetrics<E>, const IE: usize, const LE: usize> PartialEq for SafeCursor<R, E, I, IE, LE>
Source§impl<R, E: ContentTraits + Eq, I: TreeMetrics<E>, const IE: usize, const LE: usize> PartialOrd for SafeCursor<R, E, I, IE, LE>
impl<R, E: ContentTraits + Eq, I: TreeMetrics<E>, const IE: usize, const LE: usize> PartialOrd for SafeCursor<R, E, I, IE, LE>
impl<R, E: ContentTraits, I: TreeMetrics<E>, const IE: usize, const LE: usize> Eq for SafeCursor<R, E, I, IE, LE>
Auto Trait Implementations§
impl<R, E, I, const IE: usize, const LE: usize> Freeze for SafeCursor<R, E, I, IE, LE>
impl<R, E, I, const IE: usize, const LE: usize> RefUnwindSafe for SafeCursor<R, E, I, IE, LE>
impl<R, E, I, const IE: usize = DEFAULT_IE, const LE: usize = DEFAULT_LE> !Send for SafeCursor<R, E, I, IE, LE>
impl<R, E, I, const IE: usize = DEFAULT_IE, const LE: usize = DEFAULT_LE> !Sync for SafeCursor<R, E, I, IE, LE>
impl<R, E, I, const IE: usize, const LE: usize> Unpin for SafeCursor<R, E, I, IE, LE>where
R: Unpin,
impl<R, E, I, const IE: usize, const LE: usize> UnwindSafe for SafeCursor<R, E, I, IE, LE>
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