RedisString

public class RedisString: CustomStringConvertible

A class for working with Redis binary strings. All data is stored as a UTF-8 string.

  • Initialize a RedisString

    Parameter

    Parameter data: A Data struct containing the binary data to be stored in this RedisString.

    Declaration

    Swift

    public init(_ data: Data)

    Parameters

    data

    A Data struct containing the binary data to be stored in this RedisString.

  • Initialize a RedisString

    Parameter

    Parameter value: A String value to be stored in this RedisString in UTF-8 form.

    Declaration

    Swift

    public convenience init(_ value: String)

    Parameters

    value

    A String value to be stored in this RedisString in UTF-8 form.

  • Initialize a RedisString

    Parameter

    Parameter value: An Int value to be stored in this RedisString in UTF-8 form.

    Declaration

    Swift

    public convenience init(_ value: Int)

    Parameters

    value

    An Int value to be stored in this RedisString in UTF-8 form.

  • Initialize a RedisString

    Parameter

    Parameter value: A Double value to be stored in this RedisString in UTF-8 form.

    Declaration

    Swift

    public convenience init(_ value: Double)

    Parameters

    value

    A Double value to be stored in this RedisString in UTF-8 form.

  • Get the binary contents of the RedisString object

    Returns

    A Data struct containing the contents of the RedisString object.

    Declaration

    Swift

    public var asData: Data

    Return Value

    A Data struct containing the contents of the RedisString object.

  • Get the contents of the RedisString object in the form of a String

    Returns

    The contents of the RedisString object as a String.

    Declaration

    Swift

    public var asString: String

    Return Value

    The contents of the RedisString object as a String.

  • Get the contents of the RedisString object in the form of an Int

    Returns

    The contents of the RedisString object as an Int.

    Declaration

    Swift

    public var asInteger: Int

    Return Value

    The contents of the RedisString object as an Int.

  • Get the contents of the RedisString object in the form of a Double

    Returns

    The contents of the RedisString object as a Double.

    Declaration

    Swift

    public var asDouble: Double

    Return Value

    The contents of the RedisString object as a Double.

  • Get a String form, if possible, of the contents RedisString object

    Returns

    The contents of the RedisString object as a String, if the contents isn’t UTF-8, an error message is returned.

    Declaration

    Swift

    public var description: String

    Return Value

    The contents of the RedisString object as a String, if the contents isn’t UTF-8, an error message is returned.