pub struct RustModVTable {
pub build: Option<Box<dyn FnOnce(&mut App) + Send + Sync>>,
pub build_cleanup: Option<Box<dyn FnOnce(&mut App) + Send + Sync>>,
pub load: Option<Box<dyn FnMut(ModState, &ModConfig, Commands<'_, '_>, &World) -> Result<(), String> + Send + Sync>>,
pub config_keys: Option<HashSet<ConfigKey>>,
}Fields§
§build: Option<Box<dyn FnOnce(&mut App) + Send + Sync>>§build_cleanup: Option<Box<dyn FnOnce(&mut App) + Send + Sync>>§load: Option<Box<dyn FnMut(ModState, &ModConfig, Commands<'_, '_>, &World) -> Result<(), String> + Send + Sync>>§config_keys: Option<HashSet<ConfigKey>>Trait Implementations§
Source§impl Default for RustModVTable
impl Default for RustModVTable
Source§fn default() -> RustModVTable
fn default() -> RustModVTable
Returns the “default value” for a type. Read more
Source§impl ModLoaderInterface for RustModVTable
impl ModLoaderInterface for RustModVTable
Source§fn get_config_keys(&self) -> HashSet<ConfigKey>
fn get_config_keys(&self) -> HashSet<ConfigKey>
Get the keys for the mod’s config.
This is used to generate the config UI.
Source§fn build_cleanup(&mut self, app: &mut App)
fn build_cleanup(&mut self, app: &mut App)
Corresponds to App::cleanup
Source§fn load(
&mut self,
state: ModState,
config: &ModConfig,
commands: Commands<'_, '_>,
world: &World,
) -> Result<(), String>
fn load( &mut self, state: ModState, config: &ModConfig, commands: Commands<'_, '_>, world: &World, ) -> Result<(), String>
Loads the mod in a parallel fashion.
Panics: if the mod requires exclusive access.
Source§fn unloadable(&self) -> bool
fn unloadable(&self) -> bool
Is the mod able to be unloaded?
Source§fn load_exclusive(
&mut self,
mod_state: ModState,
config: &ModConfig,
world: &mut World,
) -> Result<(), String>
fn load_exclusive( &mut self, mod_state: ModState, config: &ModConfig, world: &mut World, ) -> Result<(), String>
Loads the mod with exclusive access.
Source§fn unload(
&mut self,
mod_state: ModState,
config: &ModConfig,
commands: Commands<'_, '_>,
world: &World,
) -> Result<(), String>
fn unload( &mut self, mod_state: ModState, config: &ModConfig, commands: Commands<'_, '_>, world: &World, ) -> Result<(), String>
Unloads the mod in a parallel fashion.
Panics: if the mod requires exclusive access.
Source§fn unload_exclusive(
&mut self,
mod_state: ModState,
config: &ModConfig,
world: &mut World,
) -> Result<(), String>
fn unload_exclusive( &mut self, mod_state: ModState, config: &ModConfig, world: &mut World, ) -> Result<(), String>
Unloads the mod with exclusive access.
Source§fn requires_build(&self) -> bool
fn requires_build(&self) -> bool
If the mod requires to restart the game before loading.
Auto Trait Implementations§
impl !RefUnwindSafe for RustModVTable
impl !UnwindSafe for RustModVTable
impl Freeze for RustModVTable
impl Send for RustModVTable
impl Sync for RustModVTable
impl Unpin for RustModVTable
impl UnsafeUnpin for RustModVTable
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ConditionalSend for Twhere
T: Send,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
Source§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates Self using default().