pub struct LuaApi { /* private fields */ }Expand description
Description of the Lua scripting API of a game.
Implementations§
Source§impl LuaApi
impl LuaApi
Sourcepub fn owners(&self) -> &HashMap<String, HashMap<String, LuaFunction>>
pub fn owners(&self) -> &HashMap<String, HashMap<String, LuaFunction>>
Functions by owner, then by name. The owner is the part before : or . in a call
(cm, common, FACTION_SCRIPT_INTERFACE, …), and the empty string for global functions.
Sourcepub fn events(&self) -> &HashMap<String, HashMap<String, LuaAccessor>>
pub fn events(&self) -> &HashMap<String, HashMap<String, LuaAccessor>>
Context accessors of each event, by event name, then by accessor name.
Sourcepub fn script_definitions(&self) -> &LuaDefinitions
pub fn script_definitions(&self) -> &LuaDefinitions
Members and custom events defined by the vanilla scripts.
Source§impl LuaApi
impl LuaApi
Sourcepub fn from_assembly_kit(docs_path: &Path) -> Result<Self>
pub fn from_assembly_kit(docs_path: &Path) -> Result<Self>
This function builds the API description from the scripting docs of an Assembly Kit.
§Arguments
docs_path- Path of the scripting docs. SeeASSEMBLY_KIT_SCRIPT_DOCS_PATH.
§Returns
The API described by the docs.
§Errors
Returns RLibError::AssemblyKitNotFound if the docs folder doesn’t exist, or an IO error if a page can’t be read.
Sourcepub fn add_vanilla_scripts(&mut self, dependencies: &Dependencies)
pub fn add_vanilla_scripts(&mut self, dependencies: &Dependencies)
This function completes the API with the vanilla scripts from the dependencies cache.
Events from script/events.lua missing from the docs are added without accessors, and what the
other vanilla scripts define is added to LuaApi::script_definitions.
§Arguments
dependencies- Dependencies cache with the vanilla files loaded.
Sourcepub fn hover_html(&self, target: &LuaHoverTarget) -> Option<String>
pub fn hover_html(&self, target: &LuaHoverTarget) -> Option<String>
Trait Implementations§
impl StructuralPartialEq for LuaApi
Auto Trait Implementations§
impl Freeze for LuaApi
impl RefUnwindSafe for LuaApi
impl Send for LuaApi
impl Sync for LuaApi
impl Unpin for LuaApi
impl UnsafeUnpin for LuaApi
impl UnwindSafe for LuaApi
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreimpl<T> MaybeSend for T
impl<T> MaybeSync for T
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().impl<T> Scalar for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.