Trait bonsaidb::core::schema::view::SerializedView
pub trait SerializedView: View {
type Format: OwnedDeserializer<Self::Value>;
// Required method
fn format() -> Self::Format;
// Provided methods
fn deserialize(data: &[u8]) -> Result<Self::Value, Error> { ... }
fn serialize(item: &Self::Value) -> Result<Vec<u8, Global>, Error> { ... }
fn entries<Database>(
database: &Database
) -> View<'_, Database, Self, Self::Key>
where Database: Connection { ... }
fn entries_async<Database>(
database: &Database
) -> AsyncView<'_, Database, Self, Self::Key>
where Database: AsyncConnection { ... }
}
Expand description
A View
with additional tyes and logic to handle serializing view values.
Required Associated Types§
type Format: OwnedDeserializer<Self::Value>
type Format: OwnedDeserializer<Self::Value>
The serialization format for this view.
Required Methods§
fn format() -> Self::Format
fn format() -> Self::Format
Returns the configured instance of Self::Format
.
Provided Methods§
fn deserialize(data: &[u8]) -> Result<Self::Value, Error>
fn deserialize(data: &[u8]) -> Result<Self::Value, Error>
Deserialize data
as Self::Value
using this views’s format.
fn serialize(item: &Self::Value) -> Result<Vec<u8, Global>, Error>
fn serialize(item: &Self::Value) -> Result<Vec<u8, Global>, Error>
Serialize item
using this views’s format.
fn entries<Database>(database: &Database) -> View<'_, Database, Self, Self::Key>where
Database: Connection,
fn entries<Database>(database: &Database) -> View<'_, Database, Self, Self::Key>where Database: Connection,
Returns a builder for a view query or view reduce.
fn entries_async<Database>(
database: &Database
) -> AsyncView<'_, Database, Self, Self::Key>where
Database: AsyncConnection,
fn entries_async<Database>( database: &Database ) -> AsyncView<'_, Database, Self, Self::Key>where Database: AsyncConnection,
Returns a builder for a view query or view reduce.