Backends
-
Declaration
Swift
public enum Backends
-
The type that handles hooking of methods and functions.
Unless you have specific requirements, you should be able to use one of the pre-defined backends declared on
Backends
.If you are creating a custom
Backend
implementation which is intended for distribution, declare it as a nested type in an extension on theBackends
enumeration. The backend’s name is then the type name minus theBackends.
prefix.If a custom backend name is specified via the Orion CLI, Orion will automatically attempt to import a module named
OrionBackend_<backend name>
if it exists, so it is recommended that you follow this nomenclature while naming your framework. Note that when determining the framework name, any generic arguments are stripped from the type name, and only the first component of the name is used.For example, a backend with the type
Backends.Foo.Bar<Int>
will be referred to by the nameFoo.Bar<Int>
, and Orion will attempt to auto-import a module namedOrionBackend_Foo
.For more information on backends, consult the Orion CLI documentation.
See moreDeclaration
Swift
public protocol Backend
-
A type describing a single hook.
See moreDeclaration
Swift
public enum HookDescriptor