pub trait HostStore {
// Required methods
fn open<'life0, 'async_trait>(
&'life0 mut self,
label: String,
) -> Pin<Box<dyn Future<Output = Result<Result<Resource<Store>, Error>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get<'life0, 'async_trait>(
&'life0 mut self,
self_: Resource<Store>,
key: String,
) -> Pin<Box<dyn Future<Output = Result<Result<Option<Vec<u8>>, Error>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn set<'life0, 'async_trait>(
&'life0 mut self,
self_: Resource<Store>,
key: String,
value: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<Result<(), Error>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn delete<'life0, 'async_trait>(
&'life0 mut self,
self_: Resource<Store>,
key: String,
) -> Pin<Box<dyn Future<Output = Result<Result<(), Error>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn exists<'life0, 'async_trait>(
&'life0 mut self,
self_: Resource<Store>,
key: String,
) -> Pin<Box<dyn Future<Output = Result<Result<bool, Error>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_keys<'life0, 'async_trait>(
&'life0 mut self,
self_: Resource<Store>,
) -> Pin<Box<dyn Future<Output = Result<Result<Vec<String>, Error>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn drop<'life0, 'async_trait>(
&'life0 mut self,
rep: Resource<Store>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}
Required Methods§
Sourcefn open<'life0, 'async_trait>(
&'life0 mut self,
label: String,
) -> Pin<Box<dyn Future<Output = Result<Result<Resource<Store>, Error>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn open<'life0, 'async_trait>(
&'life0 mut self,
label: String,
) -> Pin<Box<dyn Future<Output = Result<Result<Resource<Store>, Error>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Open the store with the specified label.
label
must refer to a store allowed in the spin.toml manifest.
error::no-such-store
will be raised if the label
is not recognized.
Sourcefn get<'life0, 'async_trait>(
&'life0 mut self,
self_: Resource<Store>,
key: String,
) -> Pin<Box<dyn Future<Output = Result<Result<Option<Vec<u8>>, Error>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get<'life0, 'async_trait>(
&'life0 mut self,
self_: Resource<Store>,
key: String,
) -> Pin<Box<dyn Future<Output = Result<Result<Option<Vec<u8>>, Error>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get the value associated with the specified key
Returns ok(none)
if the key does not exist.
Sourcefn set<'life0, 'async_trait>(
&'life0 mut self,
self_: Resource<Store>,
key: String,
value: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<Result<(), Error>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set<'life0, 'async_trait>(
&'life0 mut self,
self_: Resource<Store>,
key: String,
value: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<Result<(), Error>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Set the value
associated with the specified key
overwriting any existing value.
Sourcefn delete<'life0, 'async_trait>(
&'life0 mut self,
self_: Resource<Store>,
key: String,
) -> Pin<Box<dyn Future<Output = Result<Result<(), Error>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn delete<'life0, 'async_trait>(
&'life0 mut self,
self_: Resource<Store>,
key: String,
) -> Pin<Box<dyn Future<Output = Result<Result<(), Error>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Delete the tuple with the specified key
No error is raised if a tuple did not previously exist for key
.
Sourcefn exists<'life0, 'async_trait>(
&'life0 mut self,
self_: Resource<Store>,
key: String,
) -> Pin<Box<dyn Future<Output = Result<Result<bool, Error>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn exists<'life0, 'async_trait>(
&'life0 mut self,
self_: Resource<Store>,
key: String,
) -> Pin<Box<dyn Future<Output = Result<Result<bool, Error>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Return whether a tuple exists for the specified key
Sourcefn get_keys<'life0, 'async_trait>(
&'life0 mut self,
self_: Resource<Store>,
) -> Pin<Box<dyn Future<Output = Result<Result<Vec<String>, Error>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_keys<'life0, 'async_trait>(
&'life0 mut self,
self_: Resource<Store>,
) -> Pin<Box<dyn Future<Output = Result<Result<Vec<String>, Error>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Return a list of all the keys
fn drop<'life0, 'async_trait>(
&'life0 mut self,
rep: Resource<Store>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Implementations on Foreign Types§
Source§impl<_T: HostStore + ?Sized + Send> HostStore for &mut _T
impl<_T: HostStore + ?Sized + Send> HostStore for &mut _T
Source§fn open<'life0, 'async_trait>(
&'life0 mut self,
label: String,
) -> Pin<Box<dyn Future<Output = Result<Result<Resource<Store>, Error>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn open<'life0, 'async_trait>(
&'life0 mut self,
label: String,
) -> Pin<Box<dyn Future<Output = Result<Result<Resource<Store>, Error>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Open the store with the specified label.
label
must refer to a store allowed in the spin.toml manifest.
error::no-such-store
will be raised if the label
is not recognized.
Source§fn get<'life0, 'async_trait>(
&'life0 mut self,
self_: Resource<Store>,
key: String,
) -> Pin<Box<dyn Future<Output = Result<Result<Option<Vec<u8>>, Error>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get<'life0, 'async_trait>(
&'life0 mut self,
self_: Resource<Store>,
key: String,
) -> Pin<Box<dyn Future<Output = Result<Result<Option<Vec<u8>>, Error>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get the value associated with the specified key
Returns ok(none)
if the key does not exist.
Source§fn set<'life0, 'async_trait>(
&'life0 mut self,
self_: Resource<Store>,
key: String,
value: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<Result<(), Error>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set<'life0, 'async_trait>(
&'life0 mut self,
self_: Resource<Store>,
key: String,
value: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<Result<(), Error>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Set the value
associated with the specified key
overwriting any existing value.
Source§fn delete<'life0, 'async_trait>(
&'life0 mut self,
self_: Resource<Store>,
key: String,
) -> Pin<Box<dyn Future<Output = Result<Result<(), Error>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn delete<'life0, 'async_trait>(
&'life0 mut self,
self_: Resource<Store>,
key: String,
) -> Pin<Box<dyn Future<Output = Result<Result<(), Error>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Delete the tuple with the specified key
No error is raised if a tuple did not previously exist for key
.
Source§fn exists<'life0, 'async_trait>(
&'life0 mut self,
self_: Resource<Store>,
key: String,
) -> Pin<Box<dyn Future<Output = Result<Result<bool, Error>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn exists<'life0, 'async_trait>(
&'life0 mut self,
self_: Resource<Store>,
key: String,
) -> Pin<Box<dyn Future<Output = Result<Result<bool, Error>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Return whether a tuple exists for the specified key
Source§fn get_keys<'life0, 'async_trait>(
&'life0 mut self,
self_: Resource<Store>,
) -> Pin<Box<dyn Future<Output = Result<Result<Vec<String>, Error>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_keys<'life0, 'async_trait>(
&'life0 mut self,
self_: Resource<Store>,
) -> Pin<Box<dyn Future<Output = Result<Result<Vec<String>, Error>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Return a list of all the keys