pub struct KvStore { /* private fields */ }
Expand description
A binding to a Cloudflare KvStore.
Implementations§
Source§impl KvStore
impl KvStore
Sourcepub fn create(binding: &str) -> Result<Self, KvError>
pub fn create(binding: &str) -> Result<Self, KvError>
Creates a new KvStore
with the binding specified in your wrangler.toml
.
Sourcepub fn from_this(this: &JsValue, binding: &str) -> Result<Self, KvError>
pub fn from_this(this: &JsValue, binding: &str) -> Result<Self, KvError>
Creates a new KvStore
with the binding specified in your wrangler.toml
, using an
alternative this
value for arbitrary binding contexts.
Sourcepub fn get(&self, name: &str) -> GetOptionsBuilder
pub fn get(&self, name: &str) -> GetOptionsBuilder
Fetches the value from the kv store by name.
Sourcepub 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.
Sourcepub fn put_bytes(
&self,
name: &str,
value: &[u8],
) -> Result<PutOptionsBuilder, KvError>
pub fn put_bytes( &self, name: &str, value: &[u8], ) -> Result<PutOptionsBuilder, KvError>
Puts the specified byte slice into the kv store.
Sourcepub fn list(&self) -> ListOptionsBuilder
pub fn list(&self) -> ListOptionsBuilder
Lists the keys in the kv store.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for KvStore
impl RefUnwindSafe for KvStore
impl Unpin for KvStore
impl UnwindSafe for KvStore
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