Skip to main content

Entry

Struct Entry 

Source
pub struct Entry<'a, M, C = Lexicographic> { /* private fields */ }
Expand description

One scanned key with an unread value descriptor.

Holding an entry borrows the tree, preventing mutation through that handle. Inspecting the key never reads the value payload.

Implementations§

Source§

impl<M: Memory, C: Comparator> Entry<'_, M, C>

Source

pub fn key(&self) -> &[u8] ⓘ

Borrow the encoded key.

Source

pub const fn value_len(&self) -> u64

Encoded value size, without loading its payload.

Source

pub fn value(&self) -> Result<Vec<u8>, Error>

Load and validate this entry’s value bytes.

§Errors

Returns an error on observed payload corruption.

Source

pub fn into_pair(self) -> Result<(Vec<u8>, Vec<u8>), Error>

Consume the entry and load its value.

§Errors

Returns an error on observed payload corruption.

Auto Trait Implementations§

§

impl<'a, M, C> Freeze for Entry<'a, M, C>
where &'a BTreeMap<M, C>: Freeze,

§

impl<'a, M, C> RefUnwindSafe for Entry<'a, M, C>
where &'a BTreeMap<M, C>: RefUnwindSafe,

§

impl<'a, M, C> Send for Entry<'a, M, C>
where &'a BTreeMap<M, C>: Send,

§

impl<'a, M, C> Sync for Entry<'a, M, C>
where &'a BTreeMap<M, C>: Sync,

§

impl<'a, M, C> Unpin for Entry<'a, M, C>
where &'a BTreeMap<M, C>: Unpin,

§

impl<'a, M, C> UnsafeUnpin for Entry<'a, M, C>
where &'a BTreeMap<M, C>: UnsafeUnpin,

§

impl<'a, M, C> UnwindSafe for Entry<'a, M, C>
where &'a BTreeMap<M, C>: UnwindSafe,

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.