HookEvent

public struct HookEvent<RK, AT, RT> : Hashable where RK : HookAction

Represents a key for hooks. Hook keys are meant to be stored statically with an extension for reuse. Creating two hook keys with the same raw values but different types lead to undefined behavior.

  • The action of a hook.

    Declaration

    Swift

    public typealias Action = RK
  • The type for a closure’s arguments.

    Declaration

    Swift

    public typealias ArgumentType = AT
  • The type returned by closures.

    Declaration

    Swift

    public typealias ReturnType = RT
  • The type closures have to conform.

    Declaration

    Swift

    public typealias ClosureType = (AT) -> RT
  • The underlying raw value. Should be unique.

    Declaration

    Swift

    public let action: Action
  • Undocumented

    Declaration

    Swift

    public init(action: Action)
  • Declaration

    Swift

    public func hash(into hasher: inout Hasher)