pub struct StateOpPayload {
pub namespace: String,
pub key: String,
pub value: Option<Vec<u8>>,
pub ttl_seconds: Option<u32>,
pub cas_version: Option<u64>,
pub prefix: Option<String>,
}Expand description
Payload for a state operation request.
Fields§
§namespace: StringNamespace scoping the key, typically {env}::{tenant}::{team}.
key: StringKey within the namespace.
value: Option<Vec<u8>>Value bytes for Put / Cas operations.
ttl_seconds: Option<u32>Optional time-to-live in seconds.
cas_version: Option<u64>Expected version for compare-and-swap.
prefix: Option<String>Optional key prefix for List operations.
Implementations§
Source§impl StateOpPayload
impl StateOpPayload
Sourcepub fn get(namespace: impl Into<String>, key: impl Into<String>) -> Self
pub fn get(namespace: impl Into<String>, key: impl Into<String>) -> Self
Creates a Get payload.
Sourcepub fn put(
namespace: impl Into<String>,
key: impl Into<String>,
value: Vec<u8>,
) -> Self
pub fn put( namespace: impl Into<String>, key: impl Into<String>, value: Vec<u8>, ) -> Self
Creates a Put payload.
Sourcepub fn delete(namespace: impl Into<String>, key: impl Into<String>) -> Self
pub fn delete(namespace: impl Into<String>, key: impl Into<String>) -> Self
Creates a Delete payload.
Sourcepub fn list(namespace: impl Into<String>, prefix: impl Into<String>) -> Self
pub fn list(namespace: impl Into<String>, prefix: impl Into<String>) -> Self
Creates a List payload with a prefix filter.
Sourcepub fn with_cas_version(self, version: u64) -> Self
pub fn with_cas_version(self, version: u64) -> Self
Sets a CAS version on this payload.
Trait Implementations§
Source§impl Clone for StateOpPayload
impl Clone for StateOpPayload
Source§fn clone(&self) -> StateOpPayload
fn clone(&self) -> StateOpPayload
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StateOpPayload
impl Debug for StateOpPayload
Source§impl<'de> Deserialize<'de> for StateOpPayload
impl<'de> Deserialize<'de> for StateOpPayload
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for StateOpPayload
impl PartialEq for StateOpPayload
Source§impl Serialize for StateOpPayload
impl Serialize for StateOpPayload
impl Eq for StateOpPayload
impl StructuralPartialEq for StateOpPayload
Auto Trait Implementations§
impl Freeze for StateOpPayload
impl RefUnwindSafe for StateOpPayload
impl Send for StateOpPayload
impl Sync for StateOpPayload
impl Unpin for StateOpPayload
impl UnsafeUnpin for StateOpPayload
impl UnwindSafe for StateOpPayload
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.