Skip to content

Commit

Permalink
another safety section
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse committed Sep 13, 2023
1 parent 20a9680 commit 145731f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions crates/storage/libmdbx-rs/src/codec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,16 @@ use std::{borrow::Cow, slice};

/// Implement this to be able to decode data values
pub trait TableObject<'tx> {
/// Decodes the object from the given bytes.
fn decode(data_val: &[u8]) -> Result<Self, Error>
where
Self: Sized;

/// Decodes the value directly from the given MDBX_val pointer.
///
/// # Safety
///
/// This should only in the context of an MDBX transaction.
#[doc(hidden)]
unsafe fn decode_val<K: TransactionKind>(
_: *const ffi::MDBX_txn,
Expand Down

0 comments on commit 145731f

Please sign in to comment.