Struct ayaka_runtime::plugin::Runtime
source · pub struct Runtime<M: RawModule + Send + Sync + 'static = BackendModule> { /* private fields */ }Expand description
The plugin runtime.
Implementations§
source§impl<M: RawModule + Send + Sync + 'static> Runtime<M>
impl<M: RawModule + Send + Sync + 'static> Runtime<M>
sourcepub fn load<'a>(
dir: impl AsRef<str> + 'a,
root_path: &'a VfsPath,
names: &'a [impl AsRef<str>]
) -> impl Future<Output = Result<Arc<Self>>> + Stream<Item = LoadStatus> + 'a
pub fn load<'a>( dir: impl AsRef<str> + 'a, root_path: &'a VfsPath, names: &'a [impl AsRef<str>] ) -> impl Future<Output = Result<Arc<Self>>> + Stream<Item = LoadStatus> + 'a
Load plugins from specific directory and plugin names.
The actual load folder will be rel_to.join(dir).
If names is empty, all WASM files will be loaded.
sourcepub fn action_modules(&self) -> impl Iterator<Item = &Module<M>>
pub fn action_modules(&self) -> impl Iterator<Item = &Module<M>>
Iterates action modules.
sourcepub fn text_module(&self, cmd: &str) -> Option<&Module<M>>
pub fn text_module(&self, cmd: &str) -> Option<&Module<M>>
Gets text module from command.
sourcepub fn line_module(&self, cmd: &str) -> Option<&Module<M>>
pub fn line_module(&self, cmd: &str) -> Option<&Module<M>>
Gets line module from command.
sourcepub fn game_modules(&self) -> impl Iterator<Item = &Module<M>>
pub fn game_modules(&self) -> impl Iterator<Item = &Module<M>>
Iterates game modules.
Auto Trait Implementations§
impl<M> RefUnwindSafe for Runtime<M>where M: RefUnwindSafe,
impl<M> Send for Runtime<M>
impl<M> Sync for Runtime<M>
impl<M> Unpin for Runtime<M>where M: Unpin,
impl<M> UnwindSafe for Runtime<M>where M: UnwindSafe,
Blanket Implementations§
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere T: Any,
§fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
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.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§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.§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.