Struct embedded_redis::commands::set::SetCommand
source · 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>
§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>
§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>
§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> 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