pub struct SetCommand<R> { /* private fields */ }
Implementations§
Source§impl SetCommand<ConfirmationResponse>
impl SetCommand<ConfirmationResponse>
pub fn new<K, V>(key: K, value: V) -> Self
Sourcepub fn expires(
self,
policy: ExpirationPolicy,
) -> SetCommand<ConfirmationResponse>
pub fn expires( self, policy: ExpirationPolicy, ) -> SetCommand<ConfirmationResponse>
Set expiration (TTL)
Sourcepub fn set_exclusive(
self,
option: Exclusivity,
) -> SetCommand<ExclusiveSetResponse>
pub fn set_exclusive( self, option: Exclusivity, ) -> SetCommand<ExclusiveSetResponse>
Only set key if Exclusivity condition is met
Source§impl<R> SetCommand<R>
impl<R> SetCommand<R>
Sourcepub fn return_previous(self) -> SetCommand<ReturnPreviousResponse>
pub fn return_previous(self) -> SetCommand<ReturnPreviousResponse>
Returns the previous key by setting the GET option
Trait Implementations§
Source§impl<F> Command<F> for SetCommand<ConfirmationResponse>
impl<F> Command<F> for SetCommand<ConfirmationResponse>
Source§type Response = ()
type Response = ()
Response type, either a custom evaluated “high-level” response or the original RESP frame
Source§fn eval_response(&self, frame: F) -> Result<Self::Response, ResponseTypeError>
fn eval_response(&self, frame: F) -> Result<Self::Response, ResponseTypeError>
The command has the ability to evaluate the response frame and craft its own high level
response from that.
Its also possible to just return 1:1 the RESP2 frame. Read more
Source§impl<F> Command<F> for SetCommand<ExclusiveSetResponse>
impl<F> Command<F> for SetCommand<ExclusiveSetResponse>
Source§type Response = Option<()>
type Response = Option<()>
Response type, either a custom evaluated “high-level” response or the original RESP frame
Source§fn eval_response(&self, frame: F) -> Result<Self::Response, ResponseTypeError>
fn eval_response(&self, frame: F) -> Result<Self::Response, ResponseTypeError>
The command has the ability to evaluate the response frame and craft its own high level
response from that.
Its also possible to just return 1:1 the RESP2 frame. Read more
Source§impl<F> Command<F> for SetCommand<ReturnPreviousResponse>
impl<F> Command<F> for SetCommand<ReturnPreviousResponse>
Source§type Response = Option<Bytes>
type Response = Option<Bytes>
Response type, either a custom evaluated “high-level” response or the original RESP frame
Source§fn eval_response(&self, frame: F) -> Result<Self::Response, ResponseTypeError>
fn eval_response(&self, frame: F) -> Result<Self::Response, ResponseTypeError>
The command has the ability to evaluate the response frame and craft its own high level
response from that.
Its also possible to just return 1:1 the RESP2 frame. Read more
Auto Trait Implementations§
impl<R> !Freeze for SetCommand<R>
impl<R> RefUnwindSafe for SetCommand<R>where
R: RefUnwindSafe,
impl<R> Send for SetCommand<R>where
R: Send,
impl<R> Sync for SetCommand<R>where
R: Sync,
impl<R> Unpin for SetCommand<R>where
R: Unpin,
impl<R> UnwindSafe for SetCommand<R>where
R: UnwindSafe,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more