pub struct KeyValueDispatch { /* private fields */ }Implementations§
Source§impl KeyValueDispatch
impl KeyValueDispatch
pub fn new( allowed_stores: HashSet<String>, manager: Arc<dyn StoreManager>, ) -> Self
pub fn new_with_capacity( allowed_stores: HashSet<String>, manager: Arc<dyn StoreManager>, capacity: u32, otel: OtelFactorState, ) -> Self
pub fn get_store<T: 'static>( &self, store: Resource<T>, ) -> Result<&Arc<dyn Store>>
pub fn get_cas<T: 'static>(&self, cas: Resource<T>) -> Result<&Arc<dyn Cas>>
pub fn allowed_stores(&self) -> &HashSet<String>
pub fn get_store_wasi<T: 'static>( &self, store: Resource<T>, ) -> Result<&Arc<dyn Store>, Error>
pub fn get_cas_wasi<T: 'static>( &self, cas: Resource<T>, ) -> Result<&Arc<dyn Cas>, Error>
pub fn manager_metadata(&self) -> Arc<dyn Any> ⓘ
Trait Implementations§
Source§impl HasData for KeyValueDispatch
impl HasData for KeyValueDispatch
Source§type Data<'a> = &'a mut KeyValueDispatch
type Data<'a> = &'a mut KeyValueDispatch
The data associated with this trait implementation, chiefly used as a
generic associated type to allow plumbing the
'a lifetime into the
definition here. Read moreimpl Host for KeyValueDispatch
Source§impl Host for KeyValueDispatch
impl Host for KeyValueDispatch
Source§impl Host for KeyValueDispatch
impl Host for KeyValueDispatch
Source§impl Host for KeyValueDispatch
impl Host for KeyValueDispatch
Source§async fn get_many(
&mut self,
bucket: Resource<Bucket>,
keys: Vec<String>,
) -> Result<Vec<(String, Option<Vec<u8>>)>, Error>
async fn get_many( &mut self, bucket: Resource<Bucket>, keys: Vec<String>, ) -> Result<Vec<(String, Option<Vec<u8>>)>, Error>
Get the key-value pairs associated with the keys in the store. It returns a list of
key-value pairs. Read more
Source§impl Host for KeyValueDispatch
impl Host for KeyValueDispatch
fn convert_cas_error(&mut self, error: CasError) -> Result<CasError, Error>
Source§impl Host for KeyValueDispatch
impl Host for KeyValueDispatch
Source§async fn open(&mut self, name: String) -> Result<Result<u32, LegacyError>>
async fn open(&mut self, name: String) -> Result<Result<u32, LegacyError>>
Open the store with the specified name. Read more
Source§async fn set(
&mut self,
store: u32,
key: String,
value: Vec<u8>,
) -> Result<Result<(), LegacyError>>
async fn set( &mut self, store: u32, key: String, value: Vec<u8>, ) -> Result<Result<(), LegacyError>>
Set the
value associated with the specified key in the specified
store, overwriting any existing value. Read moreSource§impl HostBucket for KeyValueDispatch
impl HostBucket for KeyValueDispatch
Source§async fn get(
&mut self,
self_: Resource<Bucket>,
key: String,
) -> Result<Option<Vec<u8>>, Error>
async fn get( &mut self, self_: Resource<Bucket>, key: String, ) -> Result<Option<Vec<u8>>, Error>
Get the value associated with the specified
key Read moreSource§async fn set(
&mut self,
self_: Resource<Bucket>,
key: String,
value: Vec<u8>,
) -> Result<(), Error>
async fn set( &mut self, self_: Resource<Bucket>, key: String, value: Vec<u8>, ) -> Result<(), Error>
Set the value associated with the key in the store. If the key already
exists in the store, it overwrites the value. Read more
Source§async fn delete(
&mut self,
self_: Resource<Bucket>,
key: String,
) -> Result<(), Error>
async fn delete( &mut self, self_: Resource<Bucket>, key: String, ) -> Result<(), Error>
Delete the key-value pair associated with the key in the store. Read more
Source§async fn exists(
&mut self,
self_: Resource<Bucket>,
key: String,
) -> Result<bool, Error>
async fn exists( &mut self, self_: Resource<Bucket>, key: String, ) -> Result<bool, Error>
Check if the key exists in the store. Read more
Source§async fn list_keys(
&mut self,
self_: Resource<Bucket>,
cursor: Option<String>,
) -> Result<KeyResponse, Error>
async fn list_keys( &mut self, self_: Resource<Bucket>, cursor: Option<String>, ) -> Result<KeyResponse, Error>
Get all the keys in the store with an optional cursor (for use in pagination). It
returns a list of keys. Please note that for most KeyValue implementations, this is a
can be a very expensive operation and so it should be used judiciously. Implementations
can return any number of keys in a single response, but they should never attempt to
send more data than is reasonable (i.e. on a small edge device, this may only be a few
KB, while on a large machine this could be several MB). Any response should also return
a cursor that can be used to fetch the next page of keys. See the
key-response record
for more information. Read moreasync fn drop(&mut self, rep: Resource<Bucket>) -> Result<()>
Source§impl HostCas for KeyValueDispatch
impl HostCas for KeyValueDispatch
Source§async fn new(
&mut self,
bucket: Resource<Bucket>,
key: String,
) -> Result<Resource<Cas>, Error>
async fn new( &mut self, bucket: Resource<Bucket>, key: String, ) -> Result<Resource<Cas>, Error>
Construct a new CAS operation. Implementors can map the underlying functionality
(transactions, versions, etc) as desired.
Source§async fn current(
&mut self,
cas: Resource<Cas>,
) -> Result<Option<Vec<u8>>, Error>
async fn current( &mut self, cas: Resource<Cas>, ) -> Result<Option<Vec<u8>>, Error>
Get the current value of the key (if it exists). This allows for avoiding reads if all
that is needed to ensure the atomicity of the operation
async fn drop(&mut self, rep: Resource<Cas>) -> Result<()>
Source§impl HostStore for KeyValueDispatch
impl HostStore for KeyValueDispatch
Source§async fn open(&mut self, name: String) -> Result<Result<Resource<Store>, Error>>
async fn open(&mut self, name: String) -> Result<Result<Resource<Store>, Error>>
Open the store with the specified label. Read more
Source§async fn get(
&mut self,
store: Resource<Store>,
key: String,
) -> Result<Result<Option<Vec<u8>>, Error>>
async fn get( &mut self, store: Resource<Store>, key: String, ) -> Result<Result<Option<Vec<u8>>, Error>>
Get the value associated with the specified
key Read moreSource§async fn set(
&mut self,
store: Resource<Store>,
key: String,
value: Vec<u8>,
) -> Result<Result<(), Error>>
async fn set( &mut self, store: Resource<Store>, key: String, value: Vec<u8>, ) -> Result<Result<(), Error>>
Set the
value associated with the specified key overwriting any existing value.Source§async fn delete(
&mut self,
store: Resource<Store>,
key: String,
) -> Result<Result<(), Error>>
async fn delete( &mut self, store: Resource<Store>, key: String, ) -> Result<Result<(), Error>>
Delete the tuple with the specified
key Read moreSource§async fn exists(
&mut self,
store: Resource<Store>,
key: String,
) -> Result<Result<bool, Error>>
async fn exists( &mut self, store: Resource<Store>, key: String, ) -> Result<Result<bool, Error>>
Return whether a tuple exists for the specified
keySource§async fn get_keys(
&mut self,
store: Resource<Store>,
) -> Result<Result<Vec<String>, Error>>
async fn get_keys( &mut self, store: Resource<Store>, ) -> Result<Result<Vec<String>, Error>>
Return a list of all the keys
async fn drop(&mut self, store: Resource<Store>) -> Result<()>
Auto Trait Implementations§
impl !RefUnwindSafe for KeyValueDispatch
impl !UnwindSafe for KeyValueDispatch
impl Freeze for KeyValueDispatch
impl Send for KeyValueDispatch
impl Sync for KeyValueDispatch
impl Unpin for KeyValueDispatch
impl UnsafeUnpin for KeyValueDispatch
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
impl<_T> HostBucketWithStore for _T
impl<_T> HostCasWithStore for _T
impl<_T> HostConnectionWithStore for _T
impl<_T> HostConnectionWithStore for _T
impl<_T> HostConnectionWithStore for _T
impl<_T> HostConnectionWithStore for _T
impl<_T> HostConnectionWithStore for _T
impl<_T> HostConnectionWithStore for _T
impl<_T> HostConnectionWithStore for _T
impl<_T> HostConnectionWithStore for _T
impl<_T> HostDescriptorWithStore for _T
impl<_T> HostDescriptorWithStore for _T
impl<_T> HostDescriptorWithStore for _T
impl<_T> HostDirectoryEntryStreamWithStore for _T
impl<_T> HostDirectoryEntryStreamWithStore for _T
impl<_T> HostDirectoryEntryStreamWithStore for _T
impl<_T> HostErrorWithStore for _T
impl<_T> HostErrorWithStore for _T
impl<_T> HostErrorWithStore for _T
impl<_T> HostFieldsWithStore for _T
impl<_T> HostFieldsWithStore for _T
impl<_T> HostFieldsWithStore for _T
impl<_T> HostFieldsWithStore for _T
impl<_T> HostFutureIncomingResponseWithStore for _T
impl<_T> HostFutureIncomingResponseWithStore for _T
impl<_T> HostFutureIncomingResponseWithStore for _T
impl<_T> HostFutureTrailersWithStore for _T
impl<_T> HostFutureTrailersWithStore for _T
impl<_T> HostFutureTrailersWithStore for _T
impl<_T> HostIncomingBodyWithStore for _T
impl<_T> HostIncomingBodyWithStore for _T
impl<_T> HostIncomingBodyWithStore for _T
impl<_T> HostIncomingDatagramStreamWithStore for _T
impl<_T> HostIncomingDatagramStreamWithStore for _T
impl<_T> HostIncomingDatagramStreamWithStore for _T
impl<_T> HostIncomingRequestWithStore for _T
impl<_T> HostIncomingRequestWithStore for _T
impl<_T> HostIncomingRequestWithStore for _T
impl<_T> HostIncomingResponseWithStore for _T
impl<_T> HostIncomingResponseWithStore for _T
impl<_T> HostIncomingResponseWithStore for _T
impl<_T> HostInputStreamWithStore for _T
impl<_T> HostInputStreamWithStore for _T
impl<_T> HostInputStreamWithStore for _T
impl<_T> HostNetworkWithStore for _T
impl<_T> HostNetworkWithStore for _T
impl<_T> HostNetworkWithStore for _T
impl<_T> HostOutgoingBodyWithStore for _T
impl<_T> HostOutgoingBodyWithStore for _T
impl<_T> HostOutgoingBodyWithStore for _T
impl<_T> HostOutgoingDatagramStreamWithStore for _T
impl<_T> HostOutgoingDatagramStreamWithStore for _T
impl<_T> HostOutgoingDatagramStreamWithStore for _T
impl<_T> HostOutgoingRequestWithStore for _T
impl<_T> HostOutgoingRequestWithStore for _T
impl<_T> HostOutgoingRequestWithStore for _T
impl<_T> HostOutgoingResponseWithStore for _T
impl<_T> HostOutgoingResponseWithStore for _T
impl<_T> HostOutgoingResponseWithStore for _T
impl<_T> HostOutputStreamWithStore for _T
impl<_T> HostOutputStreamWithStore for _T
impl<_T> HostOutputStreamWithStore for _T
impl<_T> HostPollableWithStore for _T
impl<_T> HostPollableWithStore for _T
impl<_T> HostPollableWithStore for _T
impl<_T> HostRequestOptionsWithStore for _T
impl<_T> HostRequestOptionsWithStore for _T
impl<_T> HostRequestOptionsWithStore for _T
impl<_T> HostRequestOptionsWithStore for _T
impl<_T> HostRequestWithStore for _T
impl<_T> HostResolveAddressStreamWithStore for _T
impl<_T> HostResolveAddressStreamWithStore for _T
impl<_T> HostResolveAddressStreamWithStore for _T
impl<_T> HostResponseOutparamWithStore for _T
impl<_T> HostResponseOutparamWithStore for _T
impl<_T> HostResponseOutparamWithStore for _T
impl<_T> HostResponseWithStore for _T
impl<_T> HostStoreWithStore for _T
impl<_T> HostTcpSocketWithStore for _T
impl<_T> HostTcpSocketWithStore for _T
impl<_T> HostTcpSocketWithStore for _T
impl<_T> HostTerminalInputWithStore for _T
impl<_T> HostTerminalInputWithStore for _T
impl<_T> HostTerminalInputWithStore for _T
impl<_T> HostTerminalInputWithStore for _T
impl<_T> HostTerminalOutputWithStore for _T
impl<_T> HostTerminalOutputWithStore for _T
impl<_T> HostTerminalOutputWithStore for _T
impl<_T> HostTerminalOutputWithStore for _T
impl<_T> HostUdpSocketWithStore for _T
impl<_T> HostUdpSocketWithStore for _T
impl<_T> HostUdpSocketWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _Twhere
_T: HasData + HostFieldsWithStore + HostIncomingRequestWithStore + HostOutgoingRequestWithStore + HostRequestOptionsWithStore + HostResponseOutparamWithStore + HostIncomingResponseWithStore + HostIncomingBodyWithStore + HostFutureTrailersWithStore + HostOutgoingResponseWithStore + HostOutgoingBodyWithStore + HostFutureIncomingResponseWithStore + Send + ?Sized,
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _Twhere
_T: HasData + HostFieldsWithStore + HostIncomingRequestWithStore + HostOutgoingRequestWithStore + HostRequestOptionsWithStore + HostResponseOutparamWithStore + HostIncomingResponseWithStore + HostIncomingBodyWithStore + HostFutureTrailersWithStore + HostOutgoingResponseWithStore + HostOutgoingBodyWithStore + HostFutureIncomingResponseWithStore + Send + ?Sized,
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _Twhere
_T: HasData + HostFieldsWithStore + HostIncomingRequestWithStore + HostOutgoingRequestWithStore + HostRequestOptionsWithStore + HostResponseOutparamWithStore + HostIncomingResponseWithStore + HostIncomingBodyWithStore + HostFutureTrailersWithStore + HostOutgoingResponseWithStore + HostOutgoingBodyWithStore + HostFutureIncomingResponseWithStore + Send + ?Sized,
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
impl<_T> HostWithStore for _T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request