query_flow/query/
result.rs

1use std::sync::Arc;
2
3use crate::{error::Error, version::Version};
4
5use super::Query;
6
7pub type QueryResult<Q> = Result<QueryOutput<Q>, Error>;
8
9pub struct QueryOutput<Q: Query> {
10    value: Arc<Q::Output>,
11    version: Version,
12}
13
14impl<Q: Query> QueryOutput<Q> {
15    pub fn version(&self) -> Version {
16        self.version
17    }
18}
19
20impl<Q: Query> std::ops::Deref for QueryOutput<Q> {
21    type Target = Q::Output;
22
23    fn deref(&self) -> &Self::Target {
24        &self.value
25    }
26}