pub struct PreparedCommand<'a, E, R = ()>where
R: Response,{
pub executor: E,
pub command: Command,
pub custom_converter: Option<Box<dyn Fn(RespBuf, Command, &'a Client) -> Future<'a, R> + Send + Sync>>,
pub retry_on_error: Option<bool>,
/* private fields */
}Expand description
Wrapper around a command about to be send with a marker for the response type and a few options to decide how the response send back by Redis should be processed.
Fields§
§executor: EClient, Transaction or Pipeline that will actually send the command to the Redis server.
command: CommandCommand to send
custom_converter: Option<Box<dyn Fn(RespBuf, Command, &'a Client) -> Future<'a, R> + Send + Sync>>Custom converter to transform a RESP Buffer in to R type
retry_on_error: Option<bool>Flag to retry sending the command on network error.
Implementations§
Source§impl<'a, E, R> PreparedCommand<'a, E, R>where
R: Response,
impl<'a, E, R> PreparedCommand<'a, E, R>where
R: Response,
Sourcepub fn custom_converter(
self,
custom_converter: Box<dyn Fn(RespBuf, Command, &'a Client) -> Future<'a, R> + Send + Sync>,
) -> Self
pub fn custom_converter( self, custom_converter: Box<dyn Fn(RespBuf, Command, &'a Client) -> Future<'a, R> + Send + Sync>, ) -> Self
Set the functor PreparedCommand::custom_converter
Sourcepub fn retry_on_error(self, retry_on_error: bool) -> Self
pub fn retry_on_error(self, retry_on_error: bool) -> Self
Set a flag to override default retry_on_error behavior.
Trait Implementations§
Source§impl<'a, R: Response> BatchPreparedCommand for PreparedCommand<'a, &'a mut Pipeline<'_>, R>
impl<'a, R: Response> BatchPreparedCommand for PreparedCommand<'a, &'a mut Pipeline<'_>, R>
Source§impl<'a, R: Response> BatchPreparedCommand for PreparedCommand<'a, &'a mut Transaction, R>
impl<'a, R: Response> BatchPreparedCommand for PreparedCommand<'a, &'a mut Transaction, R>
Source§impl<'a, R: Response> ClientPreparedCommand<'a, R> for PreparedCommand<'a, &'a Client, R>
impl<'a, R: Response> ClientPreparedCommand<'a, R> for PreparedCommand<'a, &'a Client, R>
Source§impl<'a, R: Response + DeserializeOwned + 'a> IntoFuture for PreparedCommand<'a, &'a Client, R>
impl<'a, R: Response + DeserializeOwned + 'a> IntoFuture for PreparedCommand<'a, &'a Client, R>
Source§type IntoFuture = Pin<Box<dyn Future<Output = Result<R, Error>> + Send + 'a>>
type IntoFuture = Pin<Box<dyn Future<Output = Result<R, Error>> + Send + 'a>>
Which kind of future are we turning this into?
Source§fn into_future(self) -> Self::IntoFuture
fn into_future(self) -> Self::IntoFuture
Creates a future from a value. Read more
Source§impl<'a, R> IntoFuture for PreparedCommand<'a, &'a mut Connection, R>where
R: DeserializeOwned + Send + 'a,
impl<'a, R> IntoFuture for PreparedCommand<'a, &'a mut Connection, R>where
R: DeserializeOwned + Send + 'a,
Source§type IntoFuture = Pin<Box<dyn Future<Output = Result<R, Error>> + Send + 'a>>
type IntoFuture = Pin<Box<dyn Future<Output = Result<R, Error>> + Send + 'a>>
Which kind of future are we turning this into?
Source§fn into_future(self) -> Self::IntoFuture
fn into_future(self) -> Self::IntoFuture
Creates a future from a value. Read more
Source§impl<'a, R> IntoFuture for PreparedCommand<'a, &'a mut StandaloneConnection, R>where
R: DeserializeOwned + Send + 'a,
impl<'a, R> IntoFuture for PreparedCommand<'a, &'a mut StandaloneConnection, R>where
R: DeserializeOwned + Send + 'a,
Source§type IntoFuture = Pin<Box<dyn Future<Output = Result<R, Error>> + Send + 'a>>
type IntoFuture = Pin<Box<dyn Future<Output = Result<R, Error>> + Send + 'a>>
Which kind of future are we turning this into?
Source§fn into_future(self) -> Self::IntoFuture
fn into_future(self) -> Self::IntoFuture
Creates a future from a value. Read more
Auto Trait Implementations§
impl<'a, E, R = ()> !Freeze for PreparedCommand<'a, E, R>
impl<'a, E, R = ()> !RefUnwindSafe for PreparedCommand<'a, E, R>
impl<'a, E, R> Send for PreparedCommand<'a, E, R>
impl<'a, E, R> Sync for PreparedCommand<'a, E, R>
impl<'a, E, R> Unpin for PreparedCommand<'a, E, R>
impl<'a, E, R = ()> !UnwindSafe for PreparedCommand<'a, E, R>
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