Struct mongocrypt_sys::_mongocrypt_binary_t
source · #[repr(C)]pub struct _mongocrypt_binary_t {
pub data: *mut c_void,
pub len: u32,
}
Expand description
A non-owning view of a byte buffer.
When constructing a mongocrypt_binary_t it is the responsibility of the caller to maintain the lifetime of the viewed data. However, all public functions that take a mongocrypt_binary_t as an argument will make a copy of the viewed data. For example, the following is valid:
@code{.c} mongocrypt_binary_t bin = mongocrypt_binary_new_from_data(mydata, mylen); assert (mongocrypt_setopt_kms_provider_local (crypt), bin); // The viewed data of bin has been copied. Ok to free the view and the data. mongocrypt_binary_destroy (bin); my_free_fn (mydata); @endcode
Functions with a mongocrypt_binary_t* out guarantee the lifetime of the viewed data to live as long as the parent object. For example, @ref mongocrypt_ctx_mongo_op guarantees that the viewed data of mongocrypt_binary_t is valid until the parent ctx is destroyed with @ref mongocrypt_ctx_destroy.
The mongocrypt_binary_t
struct definition is public.
Consumers may rely on the struct layout.
Fields§
§data: *mut c_void
§len: u32
Trait Implementations§
source§impl Clone for _mongocrypt_binary_t
impl Clone for _mongocrypt_binary_t
source§fn clone(&self) -> _mongocrypt_binary_t
fn clone(&self) -> _mongocrypt_binary_t
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for _mongocrypt_binary_t
impl Debug for _mongocrypt_binary_t
impl Copy for _mongocrypt_binary_t
Auto Trait Implementations§
impl Freeze for _mongocrypt_binary_t
impl RefUnwindSafe for _mongocrypt_binary_t
impl !Send for _mongocrypt_binary_t
impl !Sync for _mongocrypt_binary_t
impl Unpin for _mongocrypt_binary_t
impl UnwindSafe for _mongocrypt_binary_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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)