pub struct CursorHistory<'storage> { /* private fields */ }Expand description
Cleanup-owning exact cursor history used for cycle and collision checks.
Each entry stores both the caller digest and exact cursor bytes. Equal
digests with unequal bytes fail as collisions; equal bytes with another
digest also fail closed. This type is intentionally neither Copy nor
Clone.
Implementations§
Source§impl<'storage> CursorHistory<'storage>
impl<'storage> CursorHistory<'storage>
Sourcepub fn new(
storage: &'storage mut [u8],
max_entries: u32,
) -> Result<Self, PaginationError>
pub fn new( storage: &'storage mut [u8], max_entries: u32, ) -> Result<Self, PaginationError>
Creates empty history in caller-owned cleanup storage.
Sourcepub fn observe(
&mut self,
cursor: &PaginationCursor<'_>,
digest: CursorDigest,
) -> Result<(), PaginationError>
pub fn observe( &mut self, cursor: &PaginationCursor<'_>, digest: CursorDigest, ) -> Result<(), PaginationError>
Checks and transactionally records one cursor and digest.
Trait Implementations§
Source§impl Debug for CursorHistory<'_>
impl Debug for CursorHistory<'_>
Source§impl Drop for CursorHistory<'_>
impl Drop for CursorHistory<'_>
Auto Trait Implementations§
impl<'storage> !UnwindSafe for CursorHistory<'storage>
impl<'storage> Freeze for CursorHistory<'storage>
impl<'storage> RefUnwindSafe for CursorHistory<'storage>
impl<'storage> Send for CursorHistory<'storage>
impl<'storage> Sync for CursorHistory<'storage>
impl<'storage> Unpin for CursorHistory<'storage>
impl<'storage> UnsafeUnpin for CursorHistory<'storage>
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