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 thisRedisString
.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 thisRedisString
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 thisRedisString
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 thisRedisString
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
objectReturns
A Data struct containing the contents of theRedisString
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 StringReturns
The contents of theRedisString
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 IntReturns
The contents of theRedisString
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 DoubleReturns
The contents of theRedisString
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
objectReturns
The contents of theRedisString
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.