pub struct RawBytes {
pub ptr: *const u8,
pub len: usize,
}Expand description
Raw view into SQLite-managed bytes.
The pointer/length are tied to the lifetime of the current SQLite
row/value snapshot and are invalidated by lifecycle transitions such as
step, reset, or finalize on the owning statement/value context.
Implementations must keep returned bytes stable across repeated text/blob
reads within the same snapshot. Callers that need longer-lived data must
copy the bytes.
Fields§
§ptr: *const u8Pointer to backend-owned bytes.
len: usizeByte length of ptr.
Implementations§
Source§impl RawBytes
impl RawBytes
Sourcepub unsafe fn as_slice<'a>(self) -> &'a [u8] ⓘ
pub unsafe fn as_slice<'a>(self) -> &'a [u8] ⓘ
§Safety
Caller must ensure the pointer/length remain valid for the returned slice.
Sourcepub unsafe fn as_str<'a>(self) -> Option<&'a str>
pub unsafe fn as_str<'a>(self) -> Option<&'a str>
§Safety
Caller must ensure the bytes are valid UTF-8 and remain valid for 'a.
Sourcepub unsafe fn as_str_unchecked<'a>(self) -> &'a str
pub unsafe fn as_str_unchecked<'a>(self) -> &'a str
§Safety
Caller must ensure the bytes are valid UTF-8 and remain valid for 'a.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RawBytes
impl RefUnwindSafe for RawBytes
impl !Send for RawBytes
impl !Sync for RawBytes
impl Unpin for RawBytes
impl UnsafeUnpin for RawBytes
impl UnwindSafe for RawBytes
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