VariableValue
public enum VariableValue<Value>
extension VariableValue: Encodable where Value: Encodable
extension VariableValue: ExpressibleByBooleanLiteral where Value: ExpressibleByBooleanLiteral
extension VariableValue: ExpressibleByExtendedGraphemeClusterLiteral where Value: ExpressibleByExtendedGraphemeClusterLiteral
extension VariableValue: ExpressibleByFloatLiteral where Value: ExpressibleByFloatLiteral
extension VariableValue: ExpressibleByIntegerLiteral where Value: ExpressibleByIntegerLiteral
extension VariableValue: ExpressibleByNilLiteral where Value: ExpressibleByNilLiteral
extension VariableValue: ExpressibleByStringLiteral where Value: ExpressibleByStringLiteral
extension VariableValue: ExpressibleByUnicodeScalarLiteral where Value: ExpressibleByUnicodeScalarLiteral
An enum that represents either a Variable or a value of the generic type Value
-
This variable value represents a value.
Declaration
Swift
case value(Value) -
This variable value represents a variable.
Declaration
Swift
case variable(Variable) -
A convenience initializer for values.
Declaration
Swift
public init(_ value: Value)Parameters
valueThe
Valuevalue to store.
-
Encodes this value into the given encoder.
Throws
This function throws an error if any values are invalid for the given encoder’s format.Declaration
Swift
public func encode(to encoder: Encoder) throwsParameters
encoderThe encoder to write data to.
-
Creates an instance initialized to the given Boolean value.
Declaration
Swift
public init(booleanLiteral value: Value.BooleanLiteralType)Parameters
valueThe value of the new instance.
-
Creates an instance initialized to the given value.
Declaration
Swift
public init(extendedGraphemeClusterLiteral value: Value.ExtendedGraphemeClusterLiteralType)Parameters
valueThe value of the new instance.
-
Creates an instance initialized to the specified floating-point value.
Attention
Do not call this initializer directly. Instead, initialize a variable or constant using a floating-point literal.
Declaration
Swift
public init(floatLiteral value: Value.FloatLiteralType)Parameters
valueThe value of the new instance.
-
Creates an instance initialized to the specified integer value.
Attention
Do not call this initializer directly. Instead, initialize a variable or constant using an integer literal.
Declaration
Swift
public init(integerLiteral value: Value.IntegerLiteralType)Parameters
valueThe value of the new instance.
-
Creates an instance initialized with
nil.Attention
Do not call this initializer directly. Instead, initialize a variable or constant using a nil literal.
Declaration
Swift
public init(nilLiteral: ())Parameters
nilLiteralAn empty tuple.
-
Creates an instance initialized to the given string value.
Attention
Do not call this initializer directly. Instead, initialize a variable or constant using a string literal.
Declaration
Swift
public init(stringLiteral value: Value.StringLiteralType)Parameters
valueThe value of the new instance.
-
Creates an instance initialized to the given value.
Attention
Do not call this initializer directly. Instead, initialize a variable or constant using a unicode scalar literal.
Declaration
Swift
public init(unicodeScalarLiteral value: Value.UnicodeScalarLiteralType)Parameters
valueThe value of the new instance.
View on GitHub
VariableValue Enumeration Reference