Trait bevy_datasize::RegisterSizedTypes[][src]

pub trait RegisterSizedTypes: RegisterTypesWithEstimator {
    fn register_sized_component<T>(&mut self) -> &mut Self
    where
        T: Any + DataSize + Component
, { ... }
fn register_sized_resource<T>(&mut self) -> &mut Self
    where
        T: Any + DataSize + Resource
, { ... }
fn register_sized_asset<T>(&mut self) -> &mut Self
    where
        T: Any + DataSize + Asset
, { ... }
fn register_sized_render_asset<T>(&mut self) -> &mut Self
    where
        T: Any + DataSize + RenderAsset,
        <T as RenderAsset>::PreparedAsset: Any + DataSize
, { ... } }
Expand description

[App] extension methods to register DataSize types for memory usage tracking.

For types that do not implement DataSize, you will need to implement a DataSizeEstimator for them and register them using the methods in RegisterTypesWithEstimator.

Provided methods

Registers the given [Component] type with the MemoryUsagePlugin.

The given type T will be available to query on the MemoryUsage resource.

Registers the given [Resource] type with the MemoryUsagePlugin.

The given type T will be available to query on the MemoryUsage resource.

Registers the given [Asset] type with the MemoryUsagePlugin.

The given type T will be available to query on the MemoryUsage resource.

Registers the given [Asset] type with the MemoryUsagePlugin.

The following types will be available to query on the MemoryUsage resource:

  • T
  • <T as RenderAsset>::ExtractedAsset
  • <T as RenderAsset>::PreparedAsset

Implementations on Foreign Types

Implementors