Struct worker_kv::KvStore[][src]

pub struct KvStore { /* fields omitted */ }

A binding to a Cloudflare KvStore.

Implementations

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]

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]

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

impl Clone for KvStore[src]

Auto Trait Implementations

impl RefUnwindSafe for KvStore

impl !Send for KvStore

impl !Sync for KvStore

impl Unpin for KvStore

impl UnwindSafe for KvStore

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.