pub struct HSetEx { /* private fields */ }Expand description
HSETEX key [FNX|FXX] [EX s | PX ms | EXAT ts | PXAT ts | KEEPTTL] FIELDS numfields field value [field value …]
Sets the given hash field/value pairs and their TTL in one atomic operation
(Redis 8.0+). Returns 1 if the fields were set, 0 otherwise (for example
when a FNX/FXX condition is not met).
§Example
use redis_tower_commands::HSetEx;
use redis_tower_core::RedisConnection;
let mut conn = RedisConnection::connect("127.0.0.1:6379").await?;
let set = conn
.execute(HSetEx::new("h", vec![("f1", "v1"), ("f2", "v2")]).ex(60))
.await?;Implementations§
Source§impl HSetEx
impl HSetEx
Sourcepub fn new(
key: impl Into<CommandArg>,
fields: impl IntoIterator<Item = (impl Into<CommandArg>, impl Into<CommandArg>)>,
) -> HSetEx
pub fn new( key: impl Into<CommandArg>, fields: impl IntoIterator<Item = (impl Into<CommandArg>, impl Into<CommandArg>)>, ) -> HSetEx
Create a new HSetEx command.
Sourcepub fn exat(self, timestamp: u64) -> HSetEx
pub fn exat(self, timestamp: u64) -> HSetEx
Set the fields’ expiration as a Unix timestamp in seconds.
Trait Implementations§
Source§impl Command for HSetEx
impl Command for HSetEx
Source§fn parse_response(
&self,
frame: Frame,
) -> Result<<HSetEx as Command>::Response, RedisError>
fn parse_response( &self, frame: Frame, ) -> Result<<HSetEx as Command>::Response, RedisError>
Parse a RESP response frame into the typed response. Read more
Source§fn idempotent(&self) -> bool
fn idempotent(&self) -> bool
Whether this command is safe to retry on connection errors. Read more
Source§fn is_blocking(&self) -> bool
fn is_blocking(&self) -> bool
Whether this command blocks the connection until data is available or a
timeout elapses –
BLPOP, BRPOP, BLMOVE, BZPOPMIN/BZPOPMAX, and
XREAD/XREADGROUP with BLOCK. Read moreAuto Trait Implementations§
impl !Freeze for HSetEx
impl RefUnwindSafe for HSetEx
impl Send for HSetEx
impl Sync for HSetEx
impl Unpin for HSetEx
impl UnsafeUnpin for HSetEx
impl UnwindSafe for HSetEx
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<C> RequestDeadline for Cwhere
C: Command,
impl<C> RequestDeadline for Cwhere
C: Command,
Source§fn request_deadline(&self) -> Option<Instant>
fn request_deadline(&self) -> Option<Instant>
Return the request’s absolute deadline, if it carries one.