pub trait Adapter:
Send
+ Sync
+ Debug
+ Unpin
+ 'static {
type Scanner: Scan;
// Required methods
fn info(&self) -> Info;
fn get(
&self,
path: &str,
) -> impl Future<Output = Result<Option<Buffer>>> + MaybeSend;
fn set(
&self,
path: &str,
value: Buffer,
) -> impl Future<Output = Result<()>> + MaybeSend;
fn delete(&self, path: &str) -> impl Future<Output = Result<()>> + MaybeSend;
// Provided methods
fn scan(
&self,
path: &str,
) -> impl Future<Output = Result<Self::Scanner>> + MaybeSend { ... }
fn append(
&self,
path: &str,
value: &[u8],
) -> impl Future<Output = Result<()>> + MaybeSend { ... }
}
Expand description
KvAdapter is the adapter to underlying kv services.
By implement this trait, any kv service can work as an OpenDAL Service.
Required Associated Types§
Required Methods§
Sourcefn get(
&self,
path: &str,
) -> impl Future<Output = Result<Option<Buffer>>> + MaybeSend
fn get( &self, path: &str, ) -> impl Future<Output = Result<Option<Buffer>>> + MaybeSend
Get a key from service.
- return
Ok(None)
if this key is not exist.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.