pub struct DecoderRegistration {
pub type_name: &'static str,
pub register: fn(&mut AssetService),
}Expand description
Inventory entry for an AssetDecoder that wants to be auto-registered
against an AssetService at startup.
Mirrors the existing pattern used by MaterialRegistration
(crates/khora-data/src/ecs/components/material_registry.rs),
DataSystemRegistration, and FlowRegistration.
Use this for decoder slots with a single canonical implementation
(e.g. texture, font). Slots where multiple backends compete (audio,
mesh) deliberately stay explicit at the call site — see the rationale
in decoders/audio/mod.rs and decoders/mesh/mod.rs.
inventory::submit! {
DecoderRegistration {
type_name: "texture",
register: |svc| {
svc.register_decoder::<CpuTexture>("texture", TextureDecoder);
},
}
}Fields§
§type_name: &'static strAsset type name the decoder handles. Must match what
IndexBuilder::asset_type_for_extension returns for the relevant
file extensions (e.g. "texture").
register: fn(&mut AssetService)Function that performs the registration on an AssetService.
Plain function pointer — no captures — so the entry can be embedded
in inventory::submit! (which needs 'static).
Trait Implementations§
impl Collect for DecoderRegistration
Auto Trait Implementations§
impl Freeze for DecoderRegistration
impl RefUnwindSafe for DecoderRegistration
impl Send for DecoderRegistration
impl Sync for DecoderRegistration
impl Unpin for DecoderRegistration
impl UnsafeUnpin for DecoderRegistration
impl UnwindSafe for DecoderRegistration
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> 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