Struct worker_kv::KvStore [−][src]
pub struct KvStore { /* fields omitted */ }
A binding to a Cloudflare KvStore.
Implementations
impl KvStore
[src]
impl KvStore
[src]pub fn create(binding: &str) -> Result<Self, KvError>
[src]
Creates a new KvStore
with the binding specified in your wrangler.toml
.
pub async fn get(&self, name: &str) -> Result<Option<KvValue>, KvError>
[src]
Fetches the value from the kv store by name.
pub async fn get_with_metadata<M: DeserializeOwned>(
&self,
name: &str
) -> Result<Option<(KvValue, M)>, KvError>
[src]
&self,
name: &str
) -> Result<Option<(KvValue, M)>, KvError>
Fetches the value and associated metadata from the kv store by name.
pub fn put<T: ToRawKvValue>(
&self,
name: &str,
value: T
) -> Result<PutOptionsBuilder, KvError>
[src]
&self,
name: &str,
value: T
) -> Result<PutOptionsBuilder, KvError>
Puts data into the kv store.
pub fn list(&self) -> ListOptionsBuilder
[src]
Lists the keys in the kv store.
pub async fn delete(&self, name: &str) -> Result<(), KvError>
[src]
Deletes a key in the kv store.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for KvStore
impl RefUnwindSafe for KvStore
impl UnwindSafe for KvStore
impl UnwindSafe for KvStore