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