pub struct RawBytes {
pub ptr: *const u8,
pub len: usize,
}Expand description
Raw view into SQLite-managed bytes.
The pointer/length are only valid until the next text/blob access on the same handle, or until the statement/value is reset or finalized. Callers that need longer-lived data must copy the bytes.
Fields§
§ptr: *const u8§len: usizeImplementations§
Source§impl RawBytes
impl RawBytes
pub const fn empty() -> Self
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