pub trait DetachedReader: Send {
// Required method
fn read_detached(
&mut self,
from: &Path,
) -> Pin<Box<dyn Future<Output = Result<Option<Record>, Error>> + Send>>;
}Expand description
Async reads whose futures are detached from the store.
AsyncReader’s futures borrow &mut self, so one in-flight read holds
the store’s exclusive borrow for the whole operation — a long-parked
read stalls every other request. DetachedReader splits the phases:
the store produces the future synchronously (&mut self, briefly), and
the future resolves asynchronously with no borrow of the store, so many
operations can be in flight at once.
Implementors typically clone an Arc of shared state into the future.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".