pub type AsDerefOrUsize<T, const V: usize> = OrUsize<AsDeref<T>, V>;
Expand description

When T implements Deref for usize , this will return that value or the specified value if T has no result

§Examples

#[derive(Component, Deref)]
pub struct Wrapped(usize);

fn example(query: Query<AsDerefOrUsize<Wrapped, 1>>) {
   let _: usize = query.get_single().unwrap();
}

Aliased Type§

struct AsDerefOrUsize<T, const V: usize>(/* private fields */);