pub struct Registry<K, V> { /* private fields */ }
Expand description
It is similar to a map, but where the keys are stored at comptime, but the values can be runtime variables.
Implementations§
Source§impl<K: PartialOrd + Ord + Debug, V: CubeType + Clone> Registry<K, V>
impl<K: PartialOrd + Ord + Debug, V: CubeType + Clone> Registry<K, V>
Sourcepub fn __expand_new(_: &mut Scope) -> Registry<K, V::ExpandType>
pub fn __expand_new(_: &mut Scope) -> Registry<K, V::ExpandType>
Expand function of Self::new.
Sourcepub fn find<Query: RegistryQuery<K>>(&self, query: Query) -> V
pub fn find<Query: RegistryQuery<K>>(&self, query: Query) -> V
Find an item in the registry.
§Notes
If the item isn’t present in the registry, the function will panic.
Sourcepub fn insert<Query: RegistryQuery<K>>(&mut self, query: Query, value: V)
pub fn insert<Query: RegistryQuery<K>>(&mut self, query: Query, value: V)
Insert an item in the registry.
Sourcepub fn __expand_find<Query: RegistryQuery<K>>(
_scope: &mut Scope,
state: Registry<K, V::ExpandType>,
key: Query,
) -> V::ExpandType
pub fn __expand_find<Query: RegistryQuery<K>>( _scope: &mut Scope, state: Registry<K, V::ExpandType>, key: Query, ) -> V::ExpandType
Expand function of Self::find.
Sourcepub fn __expand_insert<Key: Into<K>>(
_scope: &mut Scope,
state: Registry<K, V::ExpandType>,
key: Key,
value: V::ExpandType,
)
pub fn __expand_insert<Key: Into<K>>( _scope: &mut Scope, state: Registry<K, V::ExpandType>, key: Key, value: V::ExpandType, )
Expand function of Self::insert.
Source§impl<K: PartialOrd + Ord + Debug, V: Clone> Registry<K, V>
impl<K: PartialOrd + Ord + Debug, V: Clone> Registry<K, V>
Sourcepub fn __expand_find_method(&self, _scope: &mut Scope, key: K) -> V
pub fn __expand_find_method(&self, _scope: &mut Scope, key: K) -> V
Expand method of Self::find.
Sourcepub fn __expand_insert_method(self, _scope: &mut Scope, key: K, value: V)
pub fn __expand_insert_method(self, _scope: &mut Scope, key: K, value: V)
Expand method of Self::insert.
Trait Implementations§
Source§impl<K: PartialOrd + Ord, V> CubeDebug for Registry<K, V>
impl<K: PartialOrd + Ord, V> CubeDebug for Registry<K, V>
Source§fn set_debug_name(&self, scope: &mut Scope, name: &'static str)
fn set_debug_name(&self, scope: &mut Scope, name: &'static str)
Set the debug name of this type’s expansion. Should do nothing for types that don’t appear
at runtime
Source§impl<K: PartialOrd + Ord, V: CubeType> CubeType for Registry<K, V>
impl<K: PartialOrd + Ord, V: CubeType> CubeType for Registry<K, V>
type ExpandType = Registry<K, <V as CubeType>::ExpandType>
Source§fn init(scope: &mut Scope, expand: Self::ExpandType) -> Self::ExpandType
fn init(scope: &mut Scope, expand: Self::ExpandType) -> Self::ExpandType
Wrapper around the init method, necessary to type inference.
Auto Trait Implementations§
impl<K, V> Freeze for Registry<K, V>
impl<K, V> !RefUnwindSafe for Registry<K, V>
impl<K, V> !Send for Registry<K, V>
impl<K, V> !Sync for Registry<K, V>
impl<K, V> Unpin for Registry<K, V>
impl<K, V> !UnwindSafe for Registry<K, V>
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
Mutably borrows from an owned value. Read more