dahomey-technologies / rustis

An asynchronous Redis client for Rust
https://docs.rs/rustis
MIT License
89 stars 12 forks source link

doesn't exists example code for redis methods #74

Open ArtemIsmagilov opened 15 hours ago

ArtemIsmagilov commented 15 hours ago

I'm trying to figure out exactly how to use ACL DRYRUN through additional options. Can we add a small example for each method?

for example get, set, and etc...

    ```example
    ///     let value: String = client.get("key").await?;
    ///     assert_eq!("value", &value);
fn get<K, V>(self, key: K) -> PreparedCommand<'a, Self, V>
where
    Self: Sized,
    K: SingleArg,
    V: PrimitiveResponse,
    Self: Sized,
{
    prepare_command(self, cmd("GET").arg(key))
}


https://github.com/dahomey-technologies/rustis/blob/02d5b1a2a5fae05b67d6e76f17c61dc1da3a0dac/src/commands/server_commands.rs#L66
mcatanzariti commented 6 hours ago

Hi @ArtemIsmagilov,

Does this automatic test helps ? https://github.com/dahomey-technologies/rustis/blob/02d5b1a2a5fae05b67d6e76f17c61dc1da3a0dac/src/tests/server_commands.rs#L55

mcatanzariti commented 6 hours ago

FYI, it's the transcription of the example given in the official Redis documentation

https://redis.io/docs/latest/commands/acl-dryrun/