Skip to main content

AppKeepsExt

Trait AppKeepsExt 

Source
pub trait AppKeepsExt {
    // Required methods
    fn keeps_saved<T: Component + TypePath>(&mut self) -> &mut Self;
    fn keeps_files(&mut self, folder: &str) -> &mut Self;
    fn saved_as<T: TypePath>(&mut self, key: &'static str) -> SavedAs<'_>;
}
Expand description

Saying what a plugin keeps with the session, in its build, finish or cleanup, onto its Keeps. A plugin added without load has no entity to say it on, and nothing is recorded.

Required Methods§

Source

fn keeps_saved<T: Component + TypePath>(&mut self) -> &mut Self

This plugin keeps the saved value T (#[reflect(.., Saved)]).

Source

fn keeps_files(&mut self, folder: &str) -> &mut Self

This plugin keeps the session files under folder in PluginData::session, such as vim for vim/registers.json.

Source

fn saved_as<T: TypePath>(&mut self, key: &'static str) -> SavedAs<'_>

This plugin’s saved value T (an agent component or a resource) is logged and restored under key, such as goals.goal, rather than its type path, so a rename keeps it and a program without Bevy reads it by that key (rig-memory’s Session::value). Keys are namespaced by the plugin; a key another type has, or a second key for T, is refused with an error in the log. SavedAs::listed also lists it.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§