RedisString
public class RedisString: CustomStringConvertible
A class for working with Redis binary
strings. All data is stored as a UTF-8 string.
-
Initialize a
RedisStringParameter
Parameter data: A Data struct containing the binary data to be stored in thisRedisString.Declaration
Swift
public init(_ data: Data)Parameters
dataA Data struct containing the binary data to be stored in this
RedisString. -
Initialize a
RedisStringParameter
Parameter value: A String value to be stored in thisRedisStringin UTF-8 form.Declaration
Swift
public convenience init(_ value: String)Parameters
valueA String value to be stored in this
RedisStringin UTF-8 form. -
Initialize a
RedisStringParameter
Parameter value: An Int value to be stored in thisRedisStringin UTF-8 form.Declaration
Swift
public convenience init(_ value: Int)Parameters
valueAn Int value to be stored in this
RedisStringin UTF-8 form. -
Initialize a
RedisStringParameter
Parameter value: A Double value to be stored in thisRedisStringin UTF-8 form.Declaration
Swift
public convenience init(_ value: Double)Parameters
valueA Double value to be stored in this
RedisStringin UTF-8 form. -
Get the binary contents of the
RedisStringobjectReturns
A Data struct containing the contents of theRedisStringobject.Declaration
Swift
public var asData: DataReturn Value
A Data struct containing the contents of the
RedisStringobject. -
Get the contents of the
RedisStringobject in the form of a StringReturns
The contents of theRedisStringobject as a String.Declaration
Swift
public var asString: StringReturn Value
The contents of the
RedisStringobject as a String. -
Get the contents of the
RedisStringobject in the form of an IntReturns
The contents of theRedisStringobject as an Int.Declaration
Swift
public var asInteger: IntReturn Value
The contents of the
RedisStringobject as an Int. -
Get the contents of the
RedisStringobject in the form of a DoubleReturns
The contents of theRedisStringobject as a Double.Declaration
Swift
public var asDouble: DoubleReturn Value
The contents of the
RedisStringobject as a Double. -
Get a String form, if possible, of the contents
RedisStringobjectReturns
The contents of theRedisStringobject as a String, if the contents isn’t UTF-8, an error message is returned.Declaration
Swift
public var description: StringReturn Value
The contents of the
RedisStringobject as a String, if the contents isn’t UTF-8, an error message is returned.
View on GitHub
RedisString Class Reference