Struct worker_kv::KvStore [−][src]
pub struct KvStore { /* fields omitted */ }
Expand description
A binding to a Cloudflare KvStore.
Implementations
Creates a new KvStore
with the binding specified in your wrangler.toml
.
Creates a new KvStore
with the binding specified in your wrangler.toml
, using an
alternative this
value for arbitrary binding contexts.
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>
pub async fn get_with_metadata<M: DeserializeOwned>(
&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>
pub fn put<T: ToRawKvValue>(
&self,
name: &str,
value: T
) -> Result<PutOptionsBuilder, KvError>
Puts data into the kv store.
Puts the specified byte slice into the kv store.
Lists the keys in the kv store.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for KvStore
impl UnwindSafe for KvStore
Blanket Implementations
Mutably borrows from an owned value. Read more