Skip to main content

Sqlite3Serialize

Trait Sqlite3Serialize 

Source
pub unsafe trait Sqlite3Serialize: Sqlite3Api {
    // Required methods
    unsafe fn serialize(
        &self,
        db: NonNull<Self::Db>,
        schema: Option<&str>,
        flags: u32,
    ) -> Result<OwnedBytes>;
    unsafe fn deserialize(
        &self,
        db: NonNull<Self::Db>,
        schema: Option<&str>,
        data: &[u8],
        flags: u32,
    ) -> Result<()>;
    unsafe fn free(&self, bytes: OwnedBytes);
}
Expand description

Optional backend extension for serialize/deserialize.

§Safety

Implementations must pair serialize allocations with free, and deserialize must not retain references to caller-owned data.

Required Methods§

Source

unsafe fn serialize( &self, db: NonNull<Self::Db>, schema: Option<&str>, flags: u32, ) -> Result<OwnedBytes>

Source

unsafe fn deserialize( &self, db: NonNull<Self::Db>, schema: Option<&str>, data: &[u8], flags: u32, ) -> Result<()>

Source

unsafe fn free(&self, bytes: OwnedBytes)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§