/// Sends a MDEL command to the server
///
/// # Params
///
/// * `cache` -> Target cache for the command
/// * `ids`   -> Ids to delete
///
/// # Example
///
/// ```no_run
/// # use cachem::*;
/// enum CacheName { A }
/// impl Into<u8> for CacheName {
///     fn into(self) -> u8 { 0u8 }
/// }
/// # #[tokio::main]
/// # async fn main() -> Result<(), Box<dyn std::error::Error>> {
/// // creates a new pool with one connection
/// let pool = ConnectionPool::new("127.0.0.1:1337".into(), 1usize).await?;
/// // get a connection
/// let mut conn = pool.acquire().await?;
/// conn.mdel(CacheName::A, vec![0u32, 1u32]).await;
///
/// # Ok(())
/// # }
/// ```
Sends a MDEL command to the server
Sends a MDEL command to the server
pub async fn mdel<C, I>(&mut self, cache: C, ids: Vec<I>) -> Result<(), CachemError>
    where
        C: Into<u8>,
        I: Parse + Send + Sync {
        self.0.get_mut().write_u8(Command::MDel.into()).await?;
        self.0.get_mut().write_u8(cache.into()).await?;
        ids.write(&mut self.0.get_mut()).await?;
        self.0.flush().await?;
        u8::read(&mut self.0).await?;
        Ok(())
    }
pub async fn mdel < C , I > ( & mut self , cache : C , ids : Vec < I > ) -> Result < ( ) , CachemError > where C : Into < u8 > , I : Parse + Send + Sync { self . 0 . get_mut ( ) . write_u8 ( Command :: MDel . into ( ) ) . await ? ; self . 0 . get_mut ( ) . write_u8 ( cache . into ( ) ) . await ? ; ids . write ( & mut self . 0 . get_mut ( ) ) . await ? ; self . 0 . flush ( ) . await ? ; u8 :: read ( & mut self . 0 ) . await ? ; Ok ( ( ) ) }
Sends a MDEL command to the server
Sends a MDEL command to the server
&mut self
cache
C
ids
Vec<I>
params
`cache` -> Target cache for the command
`ids`   -> Ids to delete
` cache ` - > Target cache for the command ` ids ` - > Ids to delete
example
None
use cachem::*;
enum CacheName { A }
impl Into for CacheName {
fn into(self) -> u8 { 0u8 }
}
enum CacheName { A } impl Into for CacheName { fn into ( self ) - > u8 { 0u8 } }
#[tokio::main]
None
async fn main() -> result<(), box<dyn std::error::error>> {
creates a new pool with one connection
let pool = ConnectionPool::new("127.0.0.1:1337".into(), 1usize).await?;
get a connection
let mut conn = pool.acquire().await?;
conn.mdel(CacheName::A, vec![0u32, 1u32]).await.
creates a new pool with one connection let pool = ConnectionPool :: new ( " 127 . 0 . 0 . 1 : 1337 " . into () 1usize ) . await? ; get a connection let mut conn = pool . acquire () . await? ; conn . mdel ( CacheName :: A vec! [ 0u32 1u32 ] ) . await .
ok(())
None
}
None