pub struct Schematics(/* private fields */);
Expand description
A collection of schematics for a prototype.
Internally, this stores a mapping of the schematic’s type name
to its corresponding DynamicSchematic
.
§Order
Insertion order does not matter. Schematics are treated as a map and as such, their application order is not guaranteed.
This also means that there cannot be duplicate schematics. Inserting a schematic will overwrite existing instances.
Implementations§
Source§impl Schematics
impl Schematics
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Create an empty Schematics
with the given capacity.
Sourcepub fn contains_by_name(&self, key: &str) -> bool
pub fn contains_by_name(&self, key: &str) -> bool
Returns true if the given type name of a schematic is contained.
Sourcepub fn get<T: Schematic>(&self) -> Option<&DynamicSchematic>
pub fn get<T: Schematic>(&self) -> Option<&DynamicSchematic>
Get a reference to the given schematic.
Sourcepub fn get_by_name(&self, key: &str) -> Option<&DynamicSchematic>
pub fn get_by_name(&self, key: &str) -> Option<&DynamicSchematic>
Get a reference to the schematic with the given type name.
Sourcepub fn get_mut<T: Schematic>(&mut self) -> Option<&mut DynamicSchematic>
pub fn get_mut<T: Schematic>(&mut self) -> Option<&mut DynamicSchematic>
Get a mutable reference to the given schematic.
Sourcepub fn get_mut_by_name(&mut self, key: &str) -> Option<&mut DynamicSchematic>
pub fn get_mut_by_name(&mut self, key: &str) -> Option<&mut DynamicSchematic>
Get a mutable reference to the schematic with the given type name.
Sourcepub fn insert<T: Schematic>(
&mut self,
input: T::Input,
) -> Option<DynamicSchematic>
pub fn insert<T: Schematic>( &mut self, input: T::Input, ) -> Option<DynamicSchematic>
Insert a new schematic.
Sourcepub fn insert_dynamic(
&mut self,
schematic: DynamicSchematic,
) -> Option<DynamicSchematic>
pub fn insert_dynamic( &mut self, schematic: DynamicSchematic, ) -> Option<DynamicSchematic>
Insert a new schematic dynamically.
Sourcepub fn remove<T: Schematic>(&mut self) -> Option<DynamicSchematic>
pub fn remove<T: Schematic>(&mut self) -> Option<DynamicSchematic>
Remove the given schematic.
Sourcepub fn remove_by_name(&mut self, key: &str) -> Option<DynamicSchematic>
pub fn remove_by_name(&mut self, key: &str) -> Option<DynamicSchematic>
Remove the schematic with the given type name.
Sourcepub fn iter(&self) -> Iter<'_, Cow<'static, str>, DynamicSchematic>
pub fn iter(&self) -> Iter<'_, Cow<'static, str>, DynamicSchematic>
Returns an iterator over all the schematics.
Trait Implementations§
Source§impl Debug for Schematics
impl Debug for Schematics
Source§impl Default for Schematics
impl Default for Schematics
Source§fn default() -> Schematics
fn default() -> Schematics
Source§impl FromIterator<(Cow<'static, str>, DynamicSchematic)> for Schematics
impl FromIterator<(Cow<'static, str>, DynamicSchematic)> for Schematics
Source§fn from_iter<T: IntoIterator<Item = (Cow<'static, str>, DynamicSchematic)>>(
iter: T,
) -> Self
fn from_iter<T: IntoIterator<Item = (Cow<'static, str>, DynamicSchematic)>>( iter: T, ) -> Self
Source§impl IntoIterator for Schematics
impl IntoIterator for Schematics
Auto Trait Implementations§
impl Freeze for Schematics
impl !RefUnwindSafe for Schematics
impl Send for Schematics
impl Sync for Schematics
impl Unpin for Schematics
impl !UnwindSafe for Schematics
Blanket Implementations§
Source§impl<T, U> AsBindGroupShaderType<U> for T
impl<T, U> AsBindGroupShaderType<U> for T
Source§fn as_bind_group_shader_type(&self, _images: &RenderAssets<Image>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<Image>) -> U
T
ShaderType
for self
. When used in AsBindGroup
derives, it is safe to assume that all images in self
exist.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> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<S, T> FromSchematicInput<T> for Swhere
T: Into<S>,
impl<S, T> FromSchematicInput<T> for Swhere
T: Into<S>,
fn from_input(input: T, _context: &mut SchematicContext<'_, '_>) -> S
Source§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
Source§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Self
using data from the given World