pub struct Blob { /* private fields */ }Expand description
Represents an owned BLOB object.
This container allows BLOB data to be passed to SQLite without copying.
Implementations§
Source§impl Blob
impl Blob
Sourcepub fn truncate(&mut self, len: usize)
pub fn truncate(&mut self, len: usize)
Shorten the BLOB, keeping the first len elements and dropping the rest.
If len is greater than the BLOB’s current length, this has no effect.
Sourcepub fn into_raw(self) -> *mut c_void
pub fn into_raw(self) -> *mut c_void
Consumes the BLOB, returning a pointer to the data.
After calling this function, the caller is responsible for freeing the memory previously managed by Blob. The easiest way to do this is by passing ffi::drop_blob to SQLite when this value is consumed.
Sourcepub unsafe fn from_raw(ptr: *mut c_void) -> Blob
pub unsafe fn from_raw(ptr: *mut c_void) -> Blob
Construct a BLOB from a raw pointer.
After calling this function, the raw pointer is owned by the resulting Blob.
§Safety
It is undefined behavior to call this method on anything other than a pointer that was returned by Blob::into_raw.
Sourcepub fn as_mut_slice(&mut self) -> &mut [u8] ⓘ
pub fn as_mut_slice(&mut self) -> &mut [u8] ⓘ
Mutably get the underlying BLOB data.