pub struct AssetSystem {
pub items: Vec<AssetItem>,
/* private fields */
}Fields§
§items: Vec<AssetItem>Implementations§
Source§impl AssetSystem
impl AssetSystem
pub fn new() -> Self
pub fn scan_assets_dir(&mut self, path: &Path) -> Result<(), String>
pub fn load_module(&mut self, path: PathBuf) -> Result<(), String>
pub fn get_item_module(&self, item: &AssetItem) -> Option<&LoadedMmsModule>
pub fn asset_function(&self, item: &AssetItem) -> Option<&Value>
pub fn get_module_name(&self, module_id: AssetModuleId) -> Option<String>
pub fn paint_templates(&self) -> Vec<PaintAssetTemplate>
pub fn build_asset_module_header( &self, world: &mut World, emit: &mut dyn SignalEmitter, module_name: &str, ) -> Result<ComponentId, String>
pub fn spawn_asset_component( &self, item: &AssetItem, args: Vec<Value>, world: &mut World, emit: &mut dyn SignalEmitter, ) -> Result<ComponentId, String>
pub fn spawn_asset_component_uninitialized( &self, item: &AssetItem, args: Vec<Value>, world: &mut World, render_assets: &mut RenderAssets, emit: &mut dyn SignalEmitter, ) -> Result<ComponentId, String>
pub fn spawn_assets_panel( &self, world: &mut World, render_assets: &mut RenderAssets, emit: &mut dyn SignalEmitter, parent: ComponentId, position: (f32, f32, f32), ) -> Result<ComponentId, String>
Sourcepub fn ensure_layout_root_if_needed(
world: &mut World,
root: ComponentId,
) -> Option<ComponentId>
pub fn ensure_layout_root_if_needed( world: &mut World, root: ComponentId, ) -> Option<ComponentId>
If root’s subtree contains styled elements that need layout resolution,
create a LayoutComponent and return its id. Returns None if no layout root is needed.
pub fn build_asset_item_shell( &self, world: &mut World, render_assets: &mut RenderAssets, emit: &mut dyn SignalEmitter, item: &AssetItem, _index: usize, ) -> Result<ComponentId, String>
Sourcepub fn remeasure_pending_previews(
&mut self,
world: &mut World,
render_assets: &RenderAssets,
emit: &mut dyn SignalEmitter,
)
pub fn remeasure_pending_previews( &mut self, world: &mut World, render_assets: &RenderAssets, emit: &mut dyn SignalEmitter, )
After layout has ticked, remeasure any pending preview subtrees that
were spawned with styled content but no RenderableComponent bounds.
Layout-generated background quads now exist, so bounds should return
real AABBs that we can use to compute proper scale/offset.
Trait Implementations§
Source§impl Debug for AssetSystem
impl Debug for AssetSystem
Source§impl Default for AssetSystem
impl Default for AssetSystem
Source§fn default() -> AssetSystem
fn default() -> AssetSystem
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for AssetSystem
impl !RefUnwindSafe for AssetSystem
impl !Sync for AssetSystem
impl Send for AssetSystem
impl Unpin for AssetSystem
impl UnsafeUnpin for AssetSystem
impl UnwindSafe for AssetSystem
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
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.