pub struct EmbeddedAssetRegistry { /* private fields */ }Expand description
A Resource that manages “rust source files” in a virtual in memory Dir, which is intended
to be shared with a MemoryAssetReader.
Generally this should not be interacted with directly. The embedded_asset will populate this.
Implementations§
Source§impl EmbeddedAssetRegistry
impl EmbeddedAssetRegistry
Sourcepub fn insert_asset(
&self,
full_path: PathBuf,
asset_path: &Path,
value: impl Into<Value>,
)
pub fn insert_asset( &self, full_path: PathBuf, asset_path: &Path, value: impl Into<Value>, )
Inserts a new asset. full_path is the full path (as file would return for that file, if it was capable of
running in a non-rust file). asset_path is the path that will be used to identify the asset in the embedded
AssetSource. value is the bytes that will be returned for the asset. This can be
either a &'static [u8] or a Vec<u8>.
Sourcepub fn insert_meta(
&self,
full_path: &Path,
asset_path: &Path,
value: impl Into<Value>,
)
pub fn insert_meta( &self, full_path: &Path, asset_path: &Path, value: impl Into<Value>, )
Inserts new asset metadata. full_path is the full path (as file would return for that file, if it was capable of
running in a non-rust file). asset_path is the path that will be used to identify the asset in the embedded
AssetSource. value is the bytes that will be returned for the asset. This can be either
a &'static [u8] or a Vec<u8>.
Sourcepub fn remove_asset(&self, full_path: &Path) -> Option<Data>
pub fn remove_asset(&self, full_path: &Path) -> Option<Data>
Removes an asset stored using full_path (the full path as file would return for that file, if it was capable of
running in a non-rust file). If no asset is stored with at full_path its a no-op.
It returning Option contains the originally stored Data or None.
Sourcepub fn register_source(&self, sources: &mut AssetSourceBuilders)
pub fn register_source(&self, sources: &mut AssetSourceBuilders)
Registers the EMBEDDED AssetSource with the given AssetSourceBuilders.
Trait Implementations§
Source§impl Component for EmbeddedAssetRegistry
impl Component for EmbeddedAssetRegistry
Source§const STORAGE_TYPE: StorageType = bevy_ecs::component::StorageType::SparseSet
const STORAGE_TYPE: StorageType = bevy_ecs::component::StorageType::SparseSet
Source§type Mutability = Mutable
type Mutability = Mutable
Component<Mutability = Mutable>,
while immutable components will instead have Component<Mutability = Immutable>. Read moreSource§fn register_required_components(
_requiree: ComponentId,
required_components: &mut RequiredComponentsRegistrator<'_, '_>,
)
fn register_required_components( _requiree: ComponentId, required_components: &mut RequiredComponentsRegistrator<'_, '_>, )
Source§fn clone_behavior() -> ComponentCloneBehavior
fn clone_behavior() -> ComponentCloneBehavior
Source§fn relationship_accessor() -> Option<ComponentRelationshipAccessor<Self>>
fn relationship_accessor() -> Option<ComponentRelationshipAccessor<Self>>
ComponentRelationshipAccessor required for working with relationships in dynamic contexts. Read moreSource§fn on_add() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
fn on_add() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
Source§fn on_insert() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
fn on_insert() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
Source§fn on_discard() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
fn on_discard() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
Source§fn on_remove() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
fn on_remove() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
Source§fn on_despawn() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
fn on_despawn() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
Source§fn map_entities<E>(_this: &mut Self, _mapper: &mut E)where
E: EntityMapper,
fn map_entities<E>(_this: &mut Self, _mapper: &mut E)where
E: EntityMapper,
EntityMapper. This is used to remap entities in contexts like scenes and entity cloning.
When deriving Component, this is populated by annotating fields containing entities with #[entities] Read moreSource§impl Default for EmbeddedAssetRegistry
impl Default for EmbeddedAssetRegistry
Source§fn default() -> EmbeddedAssetRegistry
fn default() -> EmbeddedAssetRegistry
impl Resource for EmbeddedAssetRegistry
Auto Trait Implementations§
impl Freeze for EmbeddedAssetRegistry
impl RefUnwindSafe for EmbeddedAssetRegistry
impl Send for EmbeddedAssetRegistry
impl Sync for EmbeddedAssetRegistry
impl Unpin for EmbeddedAssetRegistry
impl UnsafeUnpin for EmbeddedAssetRegistry
impl UnwindSafe for EmbeddedAssetRegistry
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<C> Bundle for Cwhere
C: Component,
impl<C> Bundle for Cwhere
C: Component,
fn component_ids( components: &mut ComponentsRegistrator<'_>, ) -> impl Iterator<Item = ComponentId> + use<C>
Source§fn get_component_ids(
components: &Components,
) -> impl Iterator<Item = Option<ComponentId>>
fn get_component_ids( components: &Components, ) -> impl Iterator<Item = Option<ComponentId>>
Source§impl<C> BundleFromComponents for Cwhere
C: Component,
impl<C> BundleFromComponents for Cwhere
C: Component,
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>
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<C> DynamicBundle for Cwhere
C: Component,
impl<C> DynamicBundle for Cwhere
C: Component,
Source§unsafe fn get_components(
ptr: MovingPtr<'_, C>,
func: &mut impl FnMut(StorageType, OwningPtr<'_>),
) -> <C as DynamicBundle>::Effect
unsafe fn get_components( ptr: MovingPtr<'_, C>, func: &mut impl FnMut(StorageType, OwningPtr<'_>), ) -> <C as DynamicBundle>::Effect
Source§unsafe fn apply_effect(
_ptr: MovingPtr<'_, MaybeUninit<C>>,
_entity: &mut EntityWorldMut<'_>,
)
unsafe fn apply_effect( _ptr: MovingPtr<'_, MaybeUninit<C>>, _entity: &mut EntityWorldMut<'_>, )
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().