RedisChannelName
public struct RedisChannelName:
RESPValueConvertible,
RawRepresentable,
ExpressibleByStringLiteral,
ExpressibleByStringInterpolation,
CustomStringConvertible, CustomDebugStringConvertible,
Comparable, Hashable, Codable
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)"
-
Declaration
Swift
public let rawValue: String
-
Initializes a type-safe representation of a Redis Pub/Sub channel name.
Declaration
Swift
public init(_ name: String)
Parameters
name
The name of the Redis Pub/Sub channel.
-
Declaration
Swift
public var description: String { get }
-
Declaration
Swift
public var debugDescription: String { get }
-
Declaration
Swift
public init?(fromRESP value: RESPValue)
-
Declaration
Swift
public init?(rawValue: String)
-
Declaration
Swift
public init(stringLiteral value: String)
-
Declaration
Swift
public init(from decoder: Decoder) throws
-
Declaration
Swift
public static func < (lhs: RedisChannelName, rhs: RedisChannelName) -> Bool
-
Declaration
Swift
public func convertedToRESPValue() -> RESPValue
-
Declaration
Swift
public func encode(to encoder: Encoder) throws