pub struct RegistryRef<'w> { /* private fields */ }Expand description
Read-only access to the Registry during handler dispatch.
Allows handlers to create new handlers at runtime by calling
into_handler or
into_callback on the
borrowed registry.
No ResourceId needed — the registry is part of World’s
structure, not a registered resource.
Methods from Deref<Target = Registry>§
Sourcepub fn id<T: Resource>(&self) -> ResourceId
pub fn id<T: Resource>(&self) -> ResourceId
Resolve the ResourceId for a type. Cold path — uses HashMap lookup.
§Panics
Panics if the resource type was not registered.
Sourcepub fn try_id<T: Resource>(&self) -> Option<ResourceId>
pub fn try_id<T: Resource>(&self) -> Option<ResourceId>
Try to resolve the ResourceId for a type. Returns None if the
type was not registered.
Sourcepub fn contains<T: Resource>(&self) -> bool
pub fn contains<T: Resource>(&self) -> bool
Returns true if a resource of type T has been registered.
Sourcepub fn check_access(&self, accesses: &[(Option<ResourceId>, &str)])
pub fn check_access(&self, accesses: &[(Option<ResourceId>, &str)])
Validate that a set of parameter accesses don’t conflict.
Two accesses conflict when they target the same ResourceId (same pointer). O(n²) pairwise comparison — handler arity is 1-8, so this is trivially fast at build time.
§Panics
Panics if any resource is accessed by more than one parameter.