pub trait PipelineExt {
// Required method
fn query<T: FromValkeyValue + Send>(
&self,
con: &impl SyncPipelineDispatch,
) -> ValkeyResult<T>;
// Provided method
fn exec(&self, con: &impl SyncPipelineDispatch) -> ValkeyResult<()> { ... }
}Expand description
Extension for running a Pipeline on a GLIDE sync client with
with typed decoding and zero extra payload copies.
Like the rest of the sync layer, this blocks on the internal runtime and
therefore must not be called from within an async context (doing so
panics with tokio’s “cannot block the current thread from within a runtime”
— use the async crate::PipelineExt::query_async there instead).
use glide::sync::{PipelineExt, SyncGlideClient};
let (a, b): (i64, i64) = glide::pipe()
.atomic()
.incr("c", 1)
.incr("c", 1)
.query(client)?;Required Methods§
Sourcefn query<T: FromValkeyValue + Send>(
&self,
con: &impl SyncPipelineDispatch,
) -> ValkeyResult<T>
fn query<T: FromValkeyValue + Send>( &self, con: &impl SyncPipelineDispatch, ) -> ValkeyResult<T>
Execute this pipeline on a blocking GLIDE client.
Errors abort with the first errored command’s reply. Ignored commands are
dropped before decoding, and an atomic pipeline’s EXEC reply is unwrapped.
Mirrors redis-rs’s query.
Provided Methods§
Sourcefn exec(&self, con: &impl SyncPipelineDispatch) -> ValkeyResult<()>
fn exec(&self, con: &impl SyncPipelineDispatch) -> ValkeyResult<()>
Execute this pipeline on a blocking GLIDE client, discarding the replies.
Mirrors redis-rs’s exec.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".