SassDynamicFunction
A dynamic Sass function.
These are Sass functions, written in Swift, that are not declared up-front to the compiler when
starting compilation. Instead they are returned as SassValue
s from other SassFunction
s
(that were declared up-front) so the compiler can call them later on.
Topics
Initializers
init(signature: SassFunctionSignature, function: SassFunction)
init(signature: SassFunctionSignature, function: SassFunction)
Create a new dynamic function.
The runtime holds a reference to all created SassDynamicFunction
s so they never reach deinit
.
Declaration
Swift
public init(signature: SassFunctionSignature, function: @escaping SassFunction)
Parameters
signature |
The Sass function signature. |
function |
The callback implementing the function. |
Properties
var signature: String
var signature: String
var function: SassFunction
var function: SassFunction
var id: UInt32
var id: UInt32
The ID of the function, used by the Sass compiler to refer to it.
Declaration
Swift
public let id: UInt32
Misc
static func ==(lhs: SassDynamicFunction, rhs: SassDynamicFunction) -> Bool
static func ==(lhs: SassDynamicFunction, rhs: SassDynamicFunction) -> Bool
Dynamic functions are equal if they have the same ID.
Declaration
Swift
public static func == (lhs: SassDynamicFunction, rhs: SassDynamicFunction)
-> Bool
func hash(into: inout Hasher)
func hash(into: inout Hasher)
func accept<V, R>(visitor: V) -> R
func accept<V, R>(visitor: V) -> R
Take part in the SassValueVisitor
protocol.
Declaration
Swift
public override func accept<V, R>(visitor: V) throws -> R
where V: SassValueVisitor, R == V.ReturnType
var description: String
var description: String