pub struct Cursor<K: TransactionKind, T: Table> { /* private fields */ }mdbx only.Expand description
Cursor wrapper to access KV items.
Trait Implementations§
Source§impl<K: TransactionKind, T: Table> DbCursorRO<T> for Cursor<K, T>
impl<K: TransactionKind, T: Table> DbCursorRO<T> for Cursor<K, T>
Source§fn first(&mut self) -> PairResult<T>
fn first(&mut self) -> PairResult<T>
Source§fn seek_exact(&mut self, key: <T as Table>::Key) -> PairResult<T>
fn seek_exact(&mut self, key: <T as Table>::Key) -> PairResult<T>
key.Source§fn seek(&mut self, key: <T as Table>::Key) -> PairResult<T>
fn seek(&mut self, key: <T as Table>::Key) -> PairResult<T>
key.Source§fn next(&mut self) -> PairResult<T>
fn next(&mut self) -> PairResult<T>
Source§fn prev(&mut self) -> PairResult<T>
fn prev(&mut self) -> PairResult<T>
Source§fn last(&mut self) -> PairResult<T>
fn last(&mut self) -> PairResult<T>
Source§fn current(&mut self) -> PairResult<T>
fn current(&mut self) -> PairResult<T>
Source§fn walk(
&mut self,
start_key: Option<T::Key>,
) -> Result<Walker<'_, T, Self>, DatabaseError>
fn walk( &mut self, start_key: Option<T::Key>, ) -> Result<Walker<'_, T, Self>, DatabaseError>
Source§fn walk_range(
&mut self,
range: impl RangeBounds<T::Key>,
) -> Result<RangeWalker<'_, T, Self>, DatabaseError>
fn walk_range( &mut self, range: impl RangeBounds<T::Key>, ) -> Result<RangeWalker<'_, T, Self>, DatabaseError>
Source§fn walk_back(
&mut self,
start_key: Option<T::Key>,
) -> Result<ReverseWalker<'_, T, Self>, DatabaseError>
fn walk_back( &mut self, start_key: Option<T::Key>, ) -> Result<ReverseWalker<'_, T, Self>, DatabaseError>
Source§impl<T: Table> DbCursorRW<T> for Cursor<RW, T>
impl<T: Table> DbCursorRW<T> for Cursor<RW, T>
Source§fn upsert(&mut self, key: T::Key, value: &T::Value) -> Result<(), DatabaseError>
fn upsert(&mut self, key: T::Key, value: &T::Value) -> Result<(), DatabaseError>
Database operation that will update an existing row if a specified value already exists in a table, and insert a new row if the specified value doesn’t already exist
For a DUPSORT table, upsert will not actually update-or-insert. If the key already exists,
it will append the value to the subkey, even if the subkeys are the same. So if you want
to properly upsert, you’ll need to seek_exact & delete_current if the key+subkey was
found, before calling upsert.
Source§fn append(&mut self, key: T::Key, value: &T::Value) -> Result<(), DatabaseError>
fn append(&mut self, key: T::Key, value: &T::Value) -> Result<(), DatabaseError>
Appends the data to the end of the table. Consequently, the append operation will fail if the inserted key is less than the last table key
Source§fn insert(&mut self, key: T::Key, value: &T::Value) -> Result<(), DatabaseError>
fn insert(&mut self, key: T::Key, value: &T::Value) -> Result<(), DatabaseError>
Source§fn delete_current(&mut self) -> Result<(), DatabaseError>
fn delete_current(&mut self) -> Result<(), DatabaseError>
Source§impl<K: TransactionKind, T: DupSort> DbDupCursorRO<T> for Cursor<K, T>
impl<K: TransactionKind, T: DupSort> DbDupCursorRO<T> for Cursor<K, T>
Source§fn prev_dup(&mut self) -> PairResult<T>
fn prev_dup(&mut self) -> PairResult<T>
Returns the previous (key, value) pair of a DUPSORT table.
Source§fn next_dup(&mut self) -> PairResult<T>
fn next_dup(&mut self) -> PairResult<T>
Returns the next (key, value) pair of a DUPSORT table.
Source§fn last_dup(&mut self) -> ValueOnlyResult<T>
fn last_dup(&mut self) -> ValueOnlyResult<T>
Returns the last value of the current duplicate key.
Source§fn next_no_dup(&mut self) -> PairResult<T>
fn next_no_dup(&mut self) -> PairResult<T>
Returns the next (key, value) pair skipping the duplicates.
Source§fn next_dup_val(&mut self) -> ValueOnlyResult<T>
fn next_dup_val(&mut self) -> ValueOnlyResult<T>
Returns the next value of a duplicate key.
Source§fn walk_dup(
&mut self,
key: Option<T::Key>,
subkey: Option<T::SubKey>,
) -> Result<DupWalker<'_, T, Self>, DatabaseError>
fn walk_dup( &mut self, key: Option<T::Key>, subkey: Option<T::SubKey>, ) -> Result<DupWalker<'_, T, Self>, DatabaseError>
Depending on its arguments, returns an iterator starting at:
- Some(key), Some(subkey): a
keyitem whose data is >= thansubkey - Some(key), None: first item of a specified
key - None, Some(subkey): like first case, but in the first key
- None, None: first item in the table of a DUPSORT table.
Source§fn seek_by_key_subkey(
&mut self,
key: <T as Table>::Key,
subkey: <T as DupSort>::SubKey,
) -> ValueOnlyResult<T>
fn seek_by_key_subkey( &mut self, key: <T as Table>::Key, subkey: <T as DupSort>::SubKey, ) -> ValueOnlyResult<T>
Source§impl<T: DupSort> DbDupCursorRW<T> for Cursor<RW, T>
impl<T: DupSort> DbDupCursorRW<T> for Cursor<RW, T>
Source§fn delete_current_duplicates(&mut self) -> Result<(), DatabaseError>
fn delete_current_duplicates(&mut self) -> Result<(), DatabaseError>
Source§fn append_dup(
&mut self,
key: T::Key,
value: T::Value,
) -> Result<(), DatabaseError>
fn append_dup( &mut self, key: T::Key, value: T::Value, ) -> Result<(), DatabaseError>
Auto Trait Implementations§
impl<K, T> !RefUnwindSafe for Cursor<K, T>
impl<K, T> !UnwindSafe for Cursor<K, T>
impl<K, T> Freeze for Cursor<K, T>
impl<K, T> Send for Cursor<K, T>
impl<K, T> Sync for Cursor<K, T>
impl<K, T> Unpin for Cursor<K, T>
impl<K, T> UnsafeUnpin for Cursor<K, 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreimpl<T> MaybeDebug for Twhere
T: Debug,
§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 56 bytes