SassDynamicFunction

Swift
public final class SassDynamicFunction: SassValue

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 SassValues from other SassFunctions (that were declared up-front) so the compiler can call them later on.


Topics

Initializers

init(signature: SassFunctionSignature, function: SassFunction)

Create a new dynamic function.

The runtime holds a reference to all created SassDynamicFunctions 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

The Sass signature of the function.

Declaration
Swift
public let signature: String

var function: SassFunction

The actual function.

Declaration
Swift
public let function: SassFunction

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

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)

Hash the dynamic function

Declaration
Swift
public override func hash(into hasher: inout Hasher)

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

A short description of the value.

Declaration
Swift
public override var description: String { get }