Trait bonsaidb_core::schema::view::Serialized
source · pub trait Serialized: Send + Sync + Debug {
fn collection(&self) -> CollectionName;
fn key_description(&self) -> KeyDescription;
fn unique(&self) -> bool;
fn lazy(&self) -> bool;
fn version(&self) -> u64;
fn view_name(&self) -> ViewName;
fn map(
&self,
document: &BorrowedDocument<'_>
) -> Result<Vec<Serialized>, Error>;
fn reduce(
&self,
mappings: &[(&[u8], &[u8])],
rereduce: bool
) -> Result<Vec<u8>, Error>;
fn eager(&self) -> bool { ... }
}
Expand description
Wraps a View
with serialization to erase the associated types
Required Methods§
sourcefn collection(&self) -> CollectionName
fn collection(&self) -> CollectionName
Wraps returing <View::Collection as Collection>::collection_name()
sourcefn key_description(&self) -> KeyDescription
fn key_description(&self) -> KeyDescription
Returns the description of the view’s Key
.
sourcefn unique(&self) -> bool
fn unique(&self) -> bool
Wraps ViewSchema::unique
sourcefn lazy(&self) -> bool
fn lazy(&self) -> bool
Wraps ViewSchema::lazy
sourcefn version(&self) -> u64
fn version(&self) -> u64
Wraps ViewSchema::version
sourcefn view_name(&self) -> ViewName
fn view_name(&self) -> ViewName
Wraps View::view_name
sourcefn map(&self, document: &BorrowedDocument<'_>) -> Result<Vec<Serialized>, Error>
fn map(&self, document: &BorrowedDocument<'_>) -> Result<Vec<Serialized>, Error>
Wraps ViewSchema::map