pub async fn keys<C, R>(&mut self, cache: C) -> Result<Vec<R>, CachemError>
    where
        C: Into<u8>,
        R: Parse + Send + Sync {

        self.0.get_mut().write_u8(Command::Keys.into()).await?;
        self.0.get_mut().write_u8(cache.into()).await?;
        self.0.flush().await?;

        Ok(Vec::<R>::read(&mut self.0).await?)
    }
/// Sends a KEYS command to the server
///
/// # Params
///
/// * `cache` -> Target cache for the command
///
/// # 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.keys::<_, u32>(CacheName::A).await;
///
/// # Ok(())
/// # }
/// ```
Sends a KEYS command to the server
Sends a KEYS command to the server
pub async fn keys<C, R>(&mut self, cache: C) -> Result<Vec<R>, CachemError>
    where
        C: Into<u8>,
        R: Parse + Send + Sync {
        self.0.get_mut().write_u8(Command::Keys.into()).await?;
        self.0.get_mut().write_u8(cache.into()).await?;
        self.0.flush().await?;
        Ok(Vec::<R>::read(&mut self.0).await?)
    }
pub async fn keys < C , R > ( & mut self , cache : C ) -> Result < Vec < R > , CachemError > where C : Into < u8 > , R : Parse + Send + Sync { self . 0 . get_mut ( ) . write_u8 ( Command :: Keys . into ( ) ) . await ? ; self . 0 . get_mut ( ) . write_u8 ( cache . into ( ) ) . await ? ; self . 0 . flush ( ) . await ? ; Ok ( Vec :: < R > :: read ( & mut self . 0 ) . await ? ) }
Sends a KEYS command to the server
Sends a KEYS command to the server
&mut self
cache
C
&mut self
cache
C
params
`cache` -> Target cache for the command
` cache ` - > Target cache for the command
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.keys::<_, u32>(CacheName::A).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 . keys :: <_ u32 > ( CacheName :: A ) . await .
ok(())
None
}
None