pub struct Builder<'a, KeyValue, V> { /* private fields */ }
Expand description
Builder for a Command::Set
key-value operation.
Implementations§
§impl<'a, K, V> Builder<'a, K, V>where
K: KeyValue,
V: Serialize + Send + Sync,
impl<'a, K, V> Builder<'a, K, V>where K: KeyValue, V: Serialize + Send + Sync,
pub fn expire_in(self, duration: Duration) -> Builder<'a, K, V>
pub fn expire_in(self, duration: Duration) -> Builder<'a, K, V>
Set this key to expire after duration
from now.
pub fn expire_at(self, time: SystemTime) -> Builder<'a, K, V>
pub fn expire_at(self, time: SystemTime) -> Builder<'a, K, V>
Set this key to expire at the provided time
.
pub const fn keep_existing_expiration(self) -> Builder<'a, K, V>
pub const fn keep_existing_expiration(self) -> Builder<'a, K, V>
If the key already exists, do not update the currently set expiration.
pub const fn only_if_exists(self) -> Builder<'a, K, V>
pub const fn only_if_exists(self) -> Builder<'a, K, V>
Only set the value if this key already exists.
pub const fn only_if_vacant(self) -> Builder<'a, K, V>
pub const fn only_if_vacant(self) -> Builder<'a, K, V>
Only set the value if this key isn’t present.
pub fn returning_previous(self) -> Result<Option<Value>, Error>
pub fn returning_previous(self) -> Result<Option<Value>, Error>
Executes the Set operation, requesting the previous value be returned. If no change is made, None will be returned.
pub fn returning_previous_as<OtherV>(self) -> Result<Option<OtherV>, Error>where
OtherV: for<'de> Deserialize<'de>,
pub fn returning_previous_as<OtherV>(self) -> Result<Option<OtherV>, Error>where OtherV: for<'de> Deserialize<'de>,
Executes the Set operation, requesting the previous value be returned. If no change is made, None will be returned.
Auto Trait Implementations§
impl<'a, KeyValue, V> RefUnwindSafe for Builder<'a, KeyValue, V>where KeyValue: RefUnwindSafe, V: RefUnwindSafe,
impl<'a, KeyValue, V> Send for Builder<'a, KeyValue, V>where KeyValue: Sync, V: Sync,
impl<'a, KeyValue, V> Sync for Builder<'a, KeyValue, V>where KeyValue: Sync, V: Sync,
impl<'a, KeyValue, V> Unpin for Builder<'a, KeyValue, V>
impl<'a, KeyValue, V> UnwindSafe for Builder<'a, KeyValue, V>where KeyValue: RefUnwindSafe, V: RefUnwindSafe,
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere T: 'a,
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