Skip to main content

Pipeline

Struct Pipeline 

Source
pub struct Pipeline<'a> { /* private fields */ }
Expand description

Builder-style write queue. Returned by Store::pipeline; call fluent methods to enqueue + commit() to apply with batched AOF fsync.

Implementations§

Source§

impl<'a> Pipeline<'a>

Source

pub fn len(&self) -> usize

Number of ops queued so far.

Source

pub fn is_empty(&self) -> bool

true when no ops are queued.

Source

pub fn set(self, key: &[u8], value: &[u8]) -> Self

Source

pub fn del(self, keys: &[&[u8]]) -> Self

Source

pub fn incr(self, key: &[u8]) -> Self

Source

pub fn incr_by(self, key: &[u8], delta: i64) -> Self

Source

pub fn hset(self, key: &[u8], pairs: &[(&[u8], &[u8])]) -> Self

Source

pub fn hdel(self, key: &[u8], fields: &[&[u8]]) -> Self

Source

pub fn hincrby(self, key: &[u8], field: &[u8], delta: i64) -> Self

Source

pub fn zadd(self, key: &[u8], pairs: &[(f64, &[u8])]) -> Self

Source

pub fn zadd_flags( self, key: &[u8], pairs: &[(f64, &[u8])], flags: ZaddFlags, ) -> Self

Flags-aware ZADD (v2.1) — e.g. the GT monotonic-heal form.

Source

pub fn zrem(self, key: &[u8], members: &[&[u8]]) -> Self

Source

pub fn zincrby(self, key: &[u8], delta: f64, member: &[u8]) -> Self

Source

pub fn sadd(self, key: &[u8], members: &[&[u8]]) -> Self

Source

pub fn srem(self, key: &[u8], members: &[&[u8]]) -> Self

Source

pub fn lpush(self, key: &[u8], values: &[&[u8]]) -> Self

Source

pub fn rpush(self, key: &[u8], values: &[&[u8]]) -> Self

Source

pub fn commit(self) -> Result<()>

Apply every queued op in order. Each op acquires its own per-shard write lock — other writers see intermediate states between ops; for transactional semantics use Store::atomic instead. AOF appends batch into one fsync per shard.

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for Pipeline<'a>

§

impl<'a> !UnwindSafe for Pipeline<'a>

§

impl<'a> Freeze for Pipeline<'a>

§

impl<'a> Send for Pipeline<'a>

§

impl<'a> Sync for Pipeline<'a>

§

impl<'a> Unpin for Pipeline<'a>

§

impl<'a> UnsafeUnpin for Pipeline<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.