Plugin
How a plugin runs, whatever language it’s in.
Plugin.Kind
Section titled “Plugin.Kind”Runs plugins of one kind, provided as wraith.kind.<name> at major 1. JS and Lua are built in.
start(guest: import("salamander").Given<Wraith.Plugin.Guest>): Wraith.Pluginstart(guest: Wraith.Plugin.Guest): Wraith.PluginWraith.Plugin? Start(Wraith.Plugin.Guest guest)sal::Result<Wraith::Plugin, Wraith::StartError> start(Wraith::Plugin_Guest guest) constpub fn start(&self, guest: wraith::PluginGuest) -> Result<wraith::Plugin, wraith::StartError>fn start(self: Wraith.Plugin.Kind, guest: Wraith.Plugin.Guest) (Wraith.StartError || rt.Failure)!Wraith.Pluginuint32_t Wraith_Plugin_Kind_start(Wraith_Plugin_Kind self, Wraith_Plugin_Guest guest, Wraith_Plugin *out)Fails with StartError. Uses Plugin.Guest, Plugin.
Plugin
Section titled “Plugin”One running plugin, from its kind’s start.
stop(): voidunload(): voidmodule(): numberserviceFor(trait: string): object | nullstop()unload()module(): integerserviceFor(trait: string): anyvoid Stop()void Unload()nuint Module()Salamander.AnyObject ServiceFor(string trait)void stop() constvoid unload() constuintptr_t module() constsal::Object serviceFor(std::string_view trait) constpub fn stop(&self)pub fn unload(&self)pub fn module(&self) -> usizepub fn service_for(&self, r#trait: &str) -> salamander::Objectfn stop(self: Wraith.Plugin) voidfn unload(self: Wraith.Plugin) voidfn module(self: Wraith.Plugin) usizefn serviceFor(self: Wraith.Plugin, trait: []const u8) rt.AnyObjectvoid Wraith_Plugin_stop(Wraith_Plugin self)void Wraith_Plugin_unload(Wraith_Plugin self)uintptr_t Wraith_Plugin_module(Wraith_Plugin self)sal_object Wraith_Plugin_serviceFor(Wraith_Plugin self, sal_string trait)Its owner’s closed already, so nothing calls into what it gave out.
unload
Section titled “unload”Nothing points at its code anymore.
module
Section titled “module”Where its module’s loaded, or 0 for things like scripts.
serviceFor
Section titled “serviceFor”What its main exports for a [Service] trait in its schemas, or nothing.
StartError
Section titled “StartError”What can go wrong, besides Cancelled, Unsupported and Gone.
| Code | Error | |
|---|---|---|
| 1 | Failed |
Plugin.Guest
Section titled “Plugin.Guest”What a plugin gets as it starts.
A struct, 0x50 bytes, aligned to 8.
| Offset | Field | Type | |
|---|---|---|---|
| 0x0 | name |
string |
|
| 0x10 | dir |
string |
A copy of its folder, deleted once it’s unloaded |
| 0x20 | wraith |
Api |
Stops working once it’s unloaded. |
| 0x30 | schema |
string |
Wraith’s, its own and its dependencies’ schemas as one bundle, for languages that read them at runtime. |
| 0x40 | services |
[]Plugin.Service |
One per [Service] trait in its dependencies’ schemas. |
name: stringdir: stringwraith: Wraith.Apischema: stringservices: Array<Wraith.Plugin.Service>name: stringdir: stringwraith: Wraith.Apischema: stringservices: (Wraith.Plugin.Service)[]string Namestring DirWraith.Api? Wraithstring SchemaWraith.Plugin.Service[] Servicessal::String namesal::String dirWraith::Api wraithsal::String schemasal::Slice<Wraith::Plugin_Service> servicespub name: salamander::Strpub dir: salamander::Strpub wraith: wraith::Apipub schema: salamander::Strpub services: salamander::Slice<wraith::PluginService>name: []const u8dir: []const u8wraith: Wraith.Apischema: []const u8services: []const Wraith.Plugin.Servicesal_string namesal_string dirWraith_Api wraithsal_string schemaSlice_Wraith_Plugin_Service servicesPlugin.Service
Section titled “Plugin.Service”A plugin’s [Service] trait, as its main exports it.
A struct, 0x30 bytes, aligned to 8.
| Offset | Field | Type | |
|---|---|---|---|
| 0x0 | plugin |
string |
|
| 0x10 | trait |
string |
|
| 0x20 | obj |
object |
plugin: stringtrait: stringobj: object | nullplugin: stringtrait: stringobj: anystring Pluginstring TraitSalamander.AnyObject Objsal::String pluginsal::String traitsal::Object objpub plugin: salamander::Strpub r#trait: salamander::Strpub obj: salamander::Objectplugin: []const u8trait: []const u8obj: rt.AnyObjectsal_string pluginsal_string traitsal_object objwraith.io · Mods on the Hub · Get Wraith
Made with ♥ by Asgard
