Protocols

The following protocols are available globally.

  • An object capable of sending commands and receiving responses.

    let client = ...
    let result = client.send(command: "GET", arguments: ["my_key"])
    // result == EventLoopFuture<RESPValue>
    

    See https://redis.io/commands

    See more

    Declaration

    Swift

    public protocol RedisClient
  • An object that is capable of being converted to and from RESPValue representations arbitrarily.

    Important

    When conforming your types to be sent to a Redis server, it is expected to always be stored in a .bulkString representation. Redis will reject any other RESPValue type sent to it.

    Conforming to this protocol only provides convenience methods of translating the Swift type into a RESPValue representation within the driver, and references to a RESPValueConvertible instance should be short lived for that purpose.

    See RESPValue.

    See more

    Declaration

    Swift

    public protocol RESPValueConvertible