Read access to a store.
| 93 | |
| 94 | /// Read access to a store. |
| 95 | pub trait Read<R: QueryRecord>: Sync { |
| 96 | type ReadStream: Stream<Item = Result<R, Report<QueryError>>> + Send + Sync; |
| 97 | |
| 98 | fn read( |
| 99 | &self, |
| 100 | filters: &[Filter<'_, R>], |
| 101 | temporal_axes: Option<&QueryTemporalAxes>, |
| 102 | include_drafts: bool, |
| 103 | ) -> impl Future<Output = Result<Self::ReadStream, Report<QueryError>>> + Send; |
| 104 | |
| 105 | #[tracing::instrument(level = "info", skip(self, filters))] |
| 106 | fn read_vec( |
| 107 | &self, |
| 108 | filters: &[Filter<'_, R>], |
| 109 | temporal_axes: Option<&QueryTemporalAxes>, |
| 110 | include_drafts: bool, |
| 111 | ) -> impl Future<Output = Result<Vec<R>, Report<QueryError>>> + Send { |
| 112 | self.read(filters, temporal_axes, include_drafts) |
| 113 | .and_then(TryStreamExt::try_collect) |
| 114 | .in_current_span() |
| 115 | } |
| 116 | |
| 117 | fn read_one( |
| 118 | &self, |
| 119 | filters: &[Filter<'_, R>], |
| 120 | temporal_axes: Option<&QueryTemporalAxes>, |
| 121 | include_drafts: bool, |
| 122 | ) -> impl Future<Output = Result<R, Report<QueryError>>> + Send; |
| 123 | } |
| 124 | |
| 125 | // TODO: Add remaining CRUD traits |
no outgoing calls
no test coverage detected