pub struct RoDatabaseUnique<KC, DC, Tag = (), C = DefaultComparator> { /* private fields */ }
Expand description
Read-only wrapper for heed::Database
.
The type tag can be used to distinguish between different database
envs. Databases and txns opened within an Env
will also be tagged,
ensuring that txns created in an Env
can only be used for DBs
created/opened by the same Env
.
Implementations§
Source§impl<KC, DC, Tag, C> RoDatabaseUnique<KC, DC, Tag, C>
impl<KC, DC, Tag, C> RoDatabaseUnique<KC, DC, Tag, C>
Sourcepub fn contains_key<'a, 'txn>(
&self,
rotxn: &'txn RoTxn<'_, Tag>,
key: &'a KC::EItem,
) -> Result<bool, TryGet>
pub fn contains_key<'a, 'txn>( &self, rotxn: &'txn RoTxn<'_, Tag>, key: &'a KC::EItem, ) -> Result<bool, TryGet>
Check if the provided key exists in the db. The stored value is not decoded, if it exists.
pub fn first<'txn>(
&self,
rotxn: &'txn RoTxn<'_, Tag>,
) -> Result<Option<(KC::DItem, DC::DItem)>, First>where
KC: BytesDecode<'txn>,
DC: BytesDecode<'txn>,
pub fn iter<'a, 'txn>(
&'a self,
rotxn: &'txn RoTxn<'a, Tag>,
) -> Result<impl FallibleIterator<Item = (KC::DItem, DC::DItem), Error = IterItem> + 'txn, IterInit>where
KC: BytesDecode<'txn>,
DC: BytesDecode<'txn>,
pub fn iter_keys<'a, 'txn>( &'a self, rotxn: &'txn RoTxn<'a, Tag>, ) -> Result<impl FallibleIterator<Item = KC::DItem, Error = IterItem> + 'txn, IterInit>
pub fn last<'txn>(
&self,
rotxn: &'txn RoTxn<'_, Tag>,
) -> Result<Option<(KC::DItem, DC::DItem)>, Last>where
KC: BytesDecode<'txn>,
DC: BytesDecode<'txn>,
pub fn lazy_decode(&self) -> RoDatabaseUnique<KC, LazyDecode<DC>, Tag, C>
pub fn len(&self, rotxn: &RoTxn<'_, Tag>) -> Result<u64, Len>
pub fn name(&self) -> &str
pub fn range<'a, 'range, 'txn, R>(
&'a self,
rotxn: &'txn RoTxn<'a, Tag>,
range: &'range R,
) -> Result<impl FallibleIterator<Item = (KC::DItem, DC::DItem), Error = IterItem> + 'txn, RangeInit>where
KC: BytesDecode<'txn> + BytesEncode<'range>,
DC: BytesDecode<'txn>,
R: RangeBounds<KC::EItem>,
C: Comparator,
pub fn rev_iter<'a, 'txn>(
&'a self,
rotxn: &'txn RoTxn<'a, Tag>,
) -> Result<impl FallibleIterator<Item = (KC::DItem, DC::DItem), Error = IterItem> + 'txn, IterInit>where
KC: BytesDecode<'txn>,
DC: BytesDecode<'txn>,
pub fn try_get<'a, 'txn>(
&self,
rotxn: &'txn RoTxn<'_, Tag>,
key: &'a KC::EItem,
) -> Result<Option<DC::DItem>, TryGet>where
KC: BytesEncode<'a>,
DC: BytesDecode<'txn>,
pub fn get<'a, 'txn>(
&self,
rotxn: &'txn RoTxn<'_, Tag>,
key: &'a KC::EItem,
) -> Result<DC::DItem, Get>where
KC: BytesEncode<'a>,
DC: BytesDecode<'txn>,
Trait Implementations§
Source§impl<KC, DC, Tag, C> Clone for RoDatabaseUnique<KC, DC, Tag, C>
impl<KC, DC, Tag, C> Clone for RoDatabaseUnique<KC, DC, Tag, C>
Source§impl<KC, DC, Tag, C> Database for RoDatabaseUnique<KC, DC, Tag, C>
impl<KC, DC, Tag, C> Database for RoDatabaseUnique<KC, DC, Tag, C>
Auto Trait Implementations§
impl<KC, DC, Tag, C> Freeze for RoDatabaseUnique<KC, DC, Tag, C>
impl<KC, DC, Tag, C> RefUnwindSafe for RoDatabaseUnique<KC, DC, Tag, C>
impl<KC, DC, Tag, C> Send for RoDatabaseUnique<KC, DC, Tag, C>
impl<KC, DC, Tag, C> Sync for RoDatabaseUnique<KC, DC, Tag, C>
impl<KC, DC, Tag, C> Unpin for RoDatabaseUnique<KC, DC, Tag, C>
impl<KC, DC, Tag, C> UnwindSafe for RoDatabaseUnique<KC, DC, Tag, C>
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