pub struct Anchor<'a, 'b, T> {
pub iref: &'a mut InputRef<'b, T>,
pub index: usize,
}Expand description
Anchoring the current index of the cursor. Restore index when dropped.
Fields§
§iref: &'a mut InputRef<'b, T>Reference of InputRef.
index: usizeThe index which is used to restore the cursor when drop.
Implementations§
Methods from Deref<Target = &'a mut InputRef<'b, T>>§
Sourcepub fn scope_cursor_mut<O>(
&mut self,
jail: impl FnOnce(&mut CursorRef<'_, T>) -> O,
) -> O
pub fn scope_cursor_mut<O>( &mut self, jail: impl FnOnce(&mut CursorRef<'_, T>) -> O, ) -> O
Do something with a mutable reference of Cursor. This crate is safe if you can’t bring arguments to outside. I believe it is true.
Sourcepub fn scope_cursor<O>(&self, jail: impl FnOnce(&CursorRef<'_, T>) -> O) -> O
pub fn scope_cursor<O>(&self, jail: impl FnOnce(&CursorRef<'_, T>) -> O) -> O
Do something with a reference of Cursor. This crate is safe if you can’t bring arguments to outside. I believe it is true.
Trait Implementations§
Auto Trait Implementations§
impl<'a, 'b, T> Freeze for Anchor<'a, 'b, T>
impl<'a, 'b, T> !RefUnwindSafe for Anchor<'a, 'b, T>
impl<'a, 'b, T> !Send for Anchor<'a, 'b, T>
impl<'a, 'b, T> !Sync for Anchor<'a, 'b, T>
impl<'a, 'b, T> Unpin for Anchor<'a, 'b, T>
impl<'a, 'b, T> !UnwindSafe for Anchor<'a, 'b, T>
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