Skip to main content

RwCursor

Struct RwCursor 

Source
pub struct RwCursor<'txn> { /* private fields */ }
Expand description

A read-write cursor for navigating items within a database.

Implementations§

Source§

impl<'txn> RwCursor<'txn>

Source

pub fn reader(&mut self) -> RwCursorReader<'_>

Returns read access to this cursor. The slices it yields keep this cursor mutably borrowed, so no write can modify them while they are alive (see RwCursorReader).

Source

pub fn put<K, D>(&mut self, key: &K, data: &D, flags: WriteFlags) -> Result<()>
where K: AsRef<[u8]>, D: AsRef<[u8]>,

Puts a key/data pair into the database. The cursor will be positioned at the new data item, or on failure usually near it.

Source

pub fn del(&mut self, flags: WriteFlags) -> Result<()>

Deletes the current key/data pair.

§Flags

WriteFlags::NO_DUP_DATA may be used to delete all data items for the current key, if the database was opened with DatabaseFlags::DUP_SORT.

Trait Implementations§

Source§

impl<'txn> Debug for RwCursor<'txn>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Drop for RwCursor<'_>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

§

impl<'txn> !Send for RwCursor<'txn>

§

impl<'txn> !Sync for RwCursor<'txn>

§

impl<'txn> Freeze for RwCursor<'txn>

§

impl<'txn> RefUnwindSafe for RwCursor<'txn>

§

impl<'txn> Unpin for RwCursor<'txn>

§

impl<'txn> UnsafeUnpin for RwCursor<'txn>

§

impl<'txn> UnwindSafe for RwCursor<'txn>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.