Trait holochain_state::query::Query
source · [−]pub trait Query: Clone {
type State;
type Item: HasValidationStatus;
type Output;
fn init_fold(&self) -> StateQueryResult<Self::State>;
fn as_map(&self) -> Arc<dyn Fn(&Row<'_>) -> StateQueryResult<Self::Item>>;
fn fold(
&self,
state: Self::State,
data: Self::Item
) -> StateQueryResult<Self::State>;
fn render<S>(
&self,
state: Self::State,
stores: S
) -> StateQueryResult<Self::Output>
where
S: Store;
fn query(&self) -> String { ... }
fn params(&self) -> Vec<Params<'_>>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
{ ... }
fn as_filter(&self) -> Box<dyn Fn(&QueryData<Self>) -> bool> { ... }
fn run<S>(&self, stores: S) -> StateQueryResult<Self::Output>
where
S: Stores<Self>,
S: Store,
{ ... }
}
Expand description
You should keep your query type cheap to clone. If there is any large data put it in an Arc.