Structures

The following structures are available globally.

  • An abstract representation of a Redis command that can be sent to a Redis instance.

    An instance will retain the keyword of the command in plaintext as a String for identity purposes, while all the arguments will be stored as RESPValue representations.

    ResultType

    Each RedisCommand has a generic type referred to as ResultType that is the native Swift representation of the response Redis will send for the command.

    When creating a RedisCommand, a closure will be provided for transforming an arbitrary RESPValue instance into the ResultType.

    See more

    Declaration

    Swift

    public struct RedisCommand<ResultType>
  • A representation of a Redis hash field key.

    RedisHashFieldKey is a thin wrapper around String to provide stronger type-safety at compile-time with regards to the domain semantics of any give String value.

    It conforms to ExpressibleByStringLiteral and ExpressibleByStringInterpolation, so creating a hash field key is as simple as:

    let fieldKey: RedisHashFieldKey = "foo" // or "\(someVar)"
    
    See more

    Declaration

    Swift

    public struct RedisHashFieldKey:
        RESPValueConvertible,
        RawRepresentable,
        ExpressibleByStringLiteral, ExpressibleByStringInterpolation,
        CustomStringConvertible, CustomDebugStringConvertible,
        Comparable, Hashable, Codable
  • The supported insert behavior for a zadd command with Redis SortedSet types.

    zadd normally inserts all given elements into the SortedSet, updating the score of any element that already exist in the set.

    However, it other behaviors are available: ZADD Options.

    See more

    Declaration

    Swift

    public struct RedisZaddInsertBehavior
  • The supported behavior for what a zadd command return value should represent.

    zadd normally returns the number of new elements inserted into the set, but also supports the option to return the number of elements changed as a result of the command.

    “Changed” in this context refers to both new elements that were inserted and existing elements that had their score updated.

    See ZADD Options

    See more

    Declaration

    Swift

    public struct RedisZaddReturnBehavior
  • The supported methods for aggregating results from various Sorted Set algorithm commands in Redis.

    See the documentation for each individual command that uses this object for more details.

    See more

    Declaration

    Swift

    public struct RedisSortedSetAggregateMethod
  • A representation of the range of options for the results that can be returned from Sorted Set range operations.

    This correlates to the WITHSCORES option in Redis terminology.

    See more

    Declaration

    Swift

    public struct RedisZRangeResultOption<ResultType>
  • A condition which must hold true in order for a key to be set with the SET command.

    See SET

    See more

    Declaration

    Swift

    public struct RedisSetCommandCondition : Hashable
  • The expiration to apply when setting a key with the SET command.

    See SET

    See more

    Declaration

    Swift

    public struct RedisSetCommandExpiration : Hashable
  • If something goes wrong with any part of the Redis connection pool, errors of this type will be thrown.

    See more

    Declaration

    Swift

    public struct RedisConnectionPoolError : LocalizedError, Equatable
  • A helper object for translating between raw bytes and Swift types according to the Redis Serialization Protocol (RESP).

    See https://redis.io/topics/protocol

    See more

    Declaration

    Swift

    public struct RESPTranslator
  • A representation of a Redis Pub/Sub channel.

    RedisChannelName is a thin wrapper around String, to provide stronger type-safety at compile time.

    It conforms to ExpressibleByStringLiteral and ExpressibleByStringInterpolation, so creating an instance is simple:

    let channel: RedisChannelName = "channel1" // or "\(channelNameVariable)"
    
    See more

    Declaration

    Swift

    public struct RedisChannelName:
        RESPValueConvertible,
        RawRepresentable,
        ExpressibleByStringLiteral,
        ExpressibleByStringInterpolation,
        CustomStringConvertible, CustomDebugStringConvertible,
        Comparable, Hashable, Codable
  • When working with RedisClient, runtime errors can be thrown to indicate problems with connection state, decoding assertions, or otherwise.

    See more

    Declaration

    Swift

    public struct RedisClientError : LocalizedError, Equatable, Hashable
  • If something goes wrong with a command within Redis, it will respond with an error that is captured and represented by instances of this type.

    See more

    Declaration

    Swift

    public struct RedisError : LocalizedError
    extension RedisError: Equatable, Hashable
    extension RedisError: RESPValueConvertible
  • A representation of a key in Redis.

    RedisKey is a thin wrapper around String, to provide stronger type-safety at compile-time.

    It conforms to ExpressibleByStringLiteral and ExpressibleByStringInterpolation, so creating a key is simple:

    let key: RedisKey = "foo" // or "\(someVar)"
    
    See more

    Declaration

    Swift

    public struct RedisKey:
        RESPValueConvertible,
        RawRepresentable,
        ExpressibleByStringLiteral,
        ExpressibleByStringInterpolation,
        CustomStringConvertible, CustomDebugStringConvertible,
        Comparable, Hashable, Codable
  • The system funnel for all Metrics interactions from the Redis library.

    It is highly recommended to not interact with this directly, and to let the library use it how it sees fit.

    There is a nested enum type of RedisMetrics.Label that is available to query, match, etc. the labels used for all of the Metrics types created by the Redis library.

    See more

    Declaration

    Swift

    public struct RedisMetrics