Schema
Code and globals the plugin’s schemas declare, by name like Player.heal. Methods come from a
struct or its bases.
Schema
Section titled “Schema”Get it with Api.schema().
address(name: string): numbermethod(object: number | bigint, name: string): numberadd(name: string, text: string): voidaddress(name: string): integermethod(object: integer, name: string): integeradd(name: string, text: string)nuint Address(string name)nuint Method(nuint @object, string name)void Add(string name, string text)sal::Result<uintptr_t, Wraith::SchemaError> address(std::string_view name) constsal::Result<uintptr_t, Wraith::SchemaError> method(uintptr_t object, std::string_view name) constsal::Result<void, Wraith::SchemaError> add(std::string_view name, std::string_view text) constpub fn address(&self, name: &str) -> Result<usize, wraith::SchemaError>pub fn method(&self, object: usize, name: &str) -> Result<usize, wraith::SchemaError>pub fn add(&self, name: &str, text: &str) -> Result<(), wraith::SchemaError>fn address(self: Wraith.Schema, name: []const u8) (Wraith.SchemaError || rt.Failure)!usizefn method(self: Wraith.Schema, object: usize, name: []const u8) (Wraith.SchemaError || rt.Failure)!usizefn add(self: Wraith.Schema, name: []const u8, text: []const u8) (Wraith.SchemaError || rt.Failure)!voiduint32_t Wraith_Schema_address(Wraith_Schema self, sal_string name, uintptr_t *out)uint32_t Wraith_Schema_method(Wraith_Schema self, uintptr_t object, sal_string name, uintptr_t *out)uint32_t Wraith_Schema_add(Wraith_Schema self, sal_string name, sal_string text)address
Section titled “address”Where a function, method or static is, found once then kept. A struct’s name gives its [VirtualTable].
Fails with SchemaError.
method
Section titled “method”Where object has a method, through its own vtable for [Virtual(n)] ones.
Fails with SchemaError.
Adds or replaces the plugin’s schema file name.
Fails with SchemaError.
SchemaError
Section titled “SchemaError”What can go wrong, besides Cancelled, Unsupported and Gone.
| Code | Error | |
|---|---|---|
| 1 | Unknown |
Nothing by that name in the plugin’s schemas |
| 2 | NotFound |
Declared, but not found, like a signature that didn’t match once |
| 3 | NeedsObject |
A [Virtual(n)] method of a struct with no [VirtualTable], so it needs an object |
| 4 | Invalid |
A schema that doesn’t parse |
| 5 | Failed |
wraith.io · Mods on the Hub · Get Wraith
Made with ♥ by Asgard
