Type Alias bevy::reflect::utility::GenericTypePathCell

source ·
pub type GenericTypePathCell = GenericTypeCell<TypePathComponent>;
Expand description

Aliased Type§

struct GenericTypePathCell(/* private fields */);

Implementations

source§

impl<T> GenericTypeCell<T>
where T: TypedProperty,

source

pub const fn new() -> GenericTypeCell<T>

Initialize a GenericTypeCell for generic types.

source

pub fn get_or_insert<G, F>(&self, f: F) -> &<T as TypedProperty>::Stored
where G: Any + ?Sized, F: FnOnce() -> <T as TypedProperty>::Stored,

Returns a reference to the TypedProperty stored in the cell.

This method will then return the correct TypedProperty reference for the given type T. If there is no entry found, a new one will be generated from the given function.

Trait Implementations

source§

impl<T> Default for GenericTypeCell<T>
where T: TypedProperty,

source§

fn default() -> GenericTypeCell<T>

Returns the “default value” for a type. Read more