pub struct PubSubClientAsync { /* private fields */ }
Implementations§
Source§impl PubSubClientAsync
A PubSubClientAsync is a structure to use redis publish/subscribe functionnality.
impl PubSubClientAsync
A PubSubClientAsync is a structure to use redis publish/subscribe functionnality.
When creating a PubSubClientAsync it will automatically create a connection. Therefore when it is created it uses the host and the port.
Example:
let mut client = try!(redis_client::PubSubClientAsync::new("127.0.0.1", "6379"));
pub fn new( host: &'static str, port: &'static str, ) -> Result<PubSubClientAsync, RedisError>
Sourcepub fn exec_redis_command_async<F>(
&mut self,
redis_command: &mut RedisCommand,
cmd_callback: F,
pubsub_arg: PubSubArg,
) -> Result<(), RedisError>
pub fn exec_redis_command_async<F>( &mut self, redis_command: &mut RedisCommand, cmd_callback: F, pubsub_arg: PubSubArg, ) -> Result<(), RedisError>
Execute a redis command. The cmd_callback will be called once the command execution is over and the pump method is called. The return value indicates if the command was successfully launched.
Sourcepub fn pump(&mut self) -> Result<(), RedisError>
pub fn pump(&mut self) -> Result<(), RedisError>
Pump the result and the received value and execute the callbacks with them. If no result or received value are ready this function will return.
Trait Implementations§
Source§impl Debug for PubSubClientAsync
impl Debug for PubSubClientAsync
Source§impl Display for PubSubClientAsync
impl Display for PubSubClientAsync
Source§impl PubSubCommandAsync for PubSubClientAsync
impl PubSubCommandAsync for PubSubClientAsync
fn subscribe<C: ToString, G, S>( &mut self, channel: C, cmd_callback: G, callback: S, ) -> Result<(), RedisError>
fn psubscribe<C: ToString, G, S>( &mut self, channel: C, cmd_callback: G, callback: S, ) -> Result<(), RedisError>
fn publish<C: ToString, M: ToString, G>( &mut self, channel: C, message: M, cmd_callback: G, ) -> Result<(), RedisError>
Auto Trait Implementations§
impl Freeze for PubSubClientAsync
impl !RefUnwindSafe for PubSubClientAsync
impl !Send for PubSubClientAsync
impl !Sync for PubSubClientAsync
impl Unpin for PubSubClientAsync
impl !UnwindSafe for PubSubClientAsync
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