pub struct AssetPlugin {
pub file_path: String,
pub processed_file_path: String,
pub watch_for_changes_override: Option<bool>,
pub mode: AssetMode,
pub meta_check: AssetMetaCheck,
pub unapproved_path_mode: UnapprovedPathMode,
}Expand description
Provides “asset” loading and processing functionality. An Asset is a “runtime value” that is loaded from an AssetSource,
which can be something like a filesystem, a network, etc.
Supports flexible “modes”, such as AssetMode::Processed and
AssetMode::Unprocessed that enable using the asset workflow that best suits your project.
Fields§
§file_path: StringThe default file path to use (relative to the project root) for unprocessed assets.
processed_file_path: StringThe default file path to use (relative to the project root) for processed assets.
watch_for_changes_override: Option<bool>If set, will override the default “watch for changes” setting. By default “watch for changes” will be false unless
the watch cargo feature is set. watch can be enabled manually, or it will be automatically enabled if a specific watcher
like file_watcher is enabled.
Most use cases should leave this set to None and enable a specific watcher feature such as file_watcher to enable
watching for dev-scenarios.
mode: AssetModeThe AssetMode to use for this server.
meta_check: AssetMetaCheckHow/If asset meta files should be checked.
unapproved_path_mode: UnapprovedPathModeHow to handle load requests of files that are outside the approved directories.
Approved folders are AssetPlugin::file_path and the folder of each
AssetSource. Subfolders within these folders are also valid.
Trait Implementations§
Source§impl Default for AssetPlugin
impl Default for AssetPlugin
Source§impl Plugin for AssetPlugin
impl Plugin for AssetPlugin
Source§fn ready(&self, _app: &App) -> bool
fn ready(&self, _app: &App) -> bool
finish should be called.Source§fn finish(&self, _app: &mut App)
fn finish(&self, _app: &mut App)
App, once all plugins registered are ready. This can
be useful for plugins that depends on another plugin asynchronous setup, like the renderer.Source§fn cleanup(&self, _app: &mut App)
fn cleanup(&self, _app: &mut App)
Auto Trait Implementations§
impl Freeze for AssetPlugin
impl RefUnwindSafe for AssetPlugin
impl Send for AssetPlugin
impl Sync for AssetPlugin
impl Unpin for AssetPlugin
impl UnwindSafe for AssetPlugin
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
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>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn 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>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which 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)
&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)
&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> DowncastSend for T
impl<T> DowncastSend 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().
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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 more