ScalarConstructible
public protocol ScalarConstructible
Types conforming to this protocol can be extracted Node.Scalars.
-
Construct an instance of
Self, if possible, from the specified scalar.Note
We use static constructors to avoid overloading
init?(_ scalar: Node.Scalar)which would cause callsite ambiguities when usinginitas closure.Declaration
Swift
static func construct(from scalar: Node.Scalar) -> Self?Parameters
scalarThe
Node.Scalarfrom which to extract a value of typeSelf, if possible.Return Value
An instance of
Self, if one was successfully extracted from the scalar.
-
construct(from:Default implementation) Default Implementation
Construct an instance of
FloatingPoint & SexagesimalConvertible, if possible, from the specified scalar.Declaration
Swift
public static func construct(from scalar: Node.Scalar) -> Self?Parameters
scalarThe
Node.Scalarfrom which to extract a value of typeFloatingPoint & SexagesimalConvertible, if possible.Return Value
An instance of
FloatingPoint & SexagesimalConvertible, if one was successfully extracted from the scalar.
View on GitHub
Install in Dash