pub trait Query: Sequence {
type RangeScan: RangeScan + 'static;
// Required methods
fn get(
&self,
key: Bytes,
) -> impl Future<Output = Result<(Option<Bytes>, HashMap<String, Value>), String>> + Send;
fn range_scan(
&self,
start: Bytes,
end: Bytes,
limit: usize,
forward: bool,
) -> impl Future<Output = Result<Self::RangeScan, String>> + Send;
fn get_many(
&self,
keys: Vec<Bytes>,
) -> impl Future<Output = Result<(Vec<(Bytes, Option<Bytes>)>, HashMap<String, Value>), String>> + Send;
}Expand description
Query read capability.
Required Associated Types§
Required Methods§
Sourcefn get(
&self,
key: Bytes,
) -> impl Future<Output = Result<(Option<Bytes>, HashMap<String, Value>), String>> + Send
fn get( &self, key: Bytes, ) -> impl Future<Output = Result<(Option<Bytes>, HashMap<String, Value>), String>> + Send
Fetch the value for a single key plus backend-specific query metadata.
Returns None when the key does not exist.
Sourcefn range_scan(
&self,
start: Bytes,
end: Bytes,
limit: usize,
forward: bool,
) -> impl Future<Output = Result<Self::RangeScan, String>> + Send
fn range_scan( &self, start: Bytes, end: Bytes, limit: usize, forward: bool, ) -> impl Future<Output = Result<Self::RangeScan, String>> + Send
Cursor over keys in [start, end] (inclusive) when end is non-empty;
empty end means unbounded above. Matches store.query.v1.RangeRequest
/ ReduceRequest on the wire. limit caps rows yielded.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".