pub struct SurfaceRegistry { /* private fields */ }Expand description
Central registry for managing surface entries and lookups
Maintains indices for efficient lookup by handle, name, or component.
Implementations§
Source§impl SurfaceRegistry
impl SurfaceRegistry
Sourcepub fn insert(&mut self, entry: SurfaceEntry) -> Result<()>
pub fn insert(&mut self, entry: SurfaceEntry) -> Result<()>
Inserts a new surface entry into the registry
Sourcepub fn remove(&mut self, handle: SurfaceHandle) -> Option<SurfaceEntry>
pub fn remove(&mut self, handle: SurfaceHandle) -> Option<SurfaceEntry>
Removes and returns a surface entry by handle
Sourcepub fn get(&self, handle: SurfaceHandle) -> Option<&SurfaceEntry>
pub fn get(&self, handle: SurfaceHandle) -> Option<&SurfaceEntry>
Returns a reference to a surface entry by handle
Sourcepub fn by_handle(&self, handle: SurfaceHandle) -> Option<&SurfaceEntry>
pub fn by_handle(&self, handle: SurfaceHandle) -> Option<&SurfaceEntry>
Alias for get
Sourcepub fn get_mut(&mut self, handle: SurfaceHandle) -> Option<&mut SurfaceEntry>
pub fn get_mut(&mut self, handle: SurfaceHandle) -> Option<&mut SurfaceEntry>
Returns a mutable reference to a surface entry by handle
Sourcepub fn by_handle_mut(
&mut self,
handle: SurfaceHandle,
) -> Option<&mut SurfaceEntry>
pub fn by_handle_mut( &mut self, handle: SurfaceHandle, ) -> Option<&mut SurfaceEntry>
Alias for get_mut
Sourcepub fn by_name(&self, name: &str) -> Vec<&SurfaceEntry>
pub fn by_name(&self, name: &str) -> Vec<&SurfaceEntry>
Returns all surface entries with the given name
Sourcepub fn by_name_mut(&mut self, name: &str) -> Vec<&mut SurfaceEntry>
pub fn by_name_mut(&mut self, name: &str) -> Vec<&mut SurfaceEntry>
Returns mutable references to all surface entries with the given name
Sourcepub fn handle_by_name(&self, name: &str) -> Option<SurfaceHandle>
pub fn handle_by_name(&self, name: &str) -> Option<SurfaceHandle>
Returns the first surface handle with the given name
Sourcepub fn handles_by_name(&self, name: &str) -> Vec<SurfaceHandle> ⓘ
pub fn handles_by_name(&self, name: &str) -> Vec<SurfaceHandle> ⓘ
Returns all surface handles with the given name
Sourcepub fn name_by_handle(&self, handle: SurfaceHandle) -> Option<&str>
pub fn name_by_handle(&self, handle: SurfaceHandle) -> Option<&str>
Returns the name for a surface handle
Sourcepub fn by_component(&self, component: &str) -> Vec<&SurfaceEntry>
pub fn by_component(&self, component: &str) -> Vec<&SurfaceEntry>
Returns all surface entries for the given component
Sourcepub fn all(&self) -> impl Iterator<Item = &SurfaceEntry>
pub fn all(&self) -> impl Iterator<Item = &SurfaceEntry>
Returns an iterator over all surface entries
Sourcepub fn all_mut(&mut self) -> impl Iterator<Item = &mut SurfaceEntry>
pub fn all_mut(&mut self) -> impl Iterator<Item = &mut SurfaceEntry>
Returns an iterator over all mutable surface entries
Sourcepub fn handles(&self) -> impl Iterator<Item = SurfaceHandle> + '_
pub fn handles(&self) -> impl Iterator<Item = SurfaceHandle> + '_
Returns an iterator over all surface handles
Sourcepub fn outputs_for_surface(&self, handle: SurfaceHandle) -> Vec<OutputHandle> ⓘ
pub fn outputs_for_surface(&self, handle: SurfaceHandle) -> Vec<OutputHandle> ⓘ
Returns all output handles for a surface
Sourcepub fn surface_names(&self) -> Vec<&str>
pub fn surface_names(&self) -> Vec<&str>
Returns all surface names in the registry
Sourcepub fn component_names(&self) -> Vec<&str>
pub fn component_names(&self) -> Vec<&str>
Returns all component names in the registry
Sourcepub fn contains(&self, handle: SurfaceHandle) -> bool
pub fn contains(&self, handle: SurfaceHandle) -> bool
Checks if a surface handle exists in the registry
Sourcepub fn contains_name(&self, name: &str) -> bool
pub fn contains_name(&self, name: &str) -> bool
Checks if a surface name exists in the registry
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SurfaceRegistry
impl !RefUnwindSafe for SurfaceRegistry
impl !Send for SurfaceRegistry
impl !Sync for SurfaceRegistry
impl Unpin for SurfaceRegistry
impl !UnwindSafe for SurfaceRegistry
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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