pub struct SystemState<Param>where
Param: SystemParam + 'static,{ /* private fields */ }Expand description
Holds on to persistent state required to drive SystemParam for a System.
This is a powerful and convenient tool for working with exclusive world access,
allowing you to fetch data from the World as if you were running a System.
However, simply calling world::run_system(my_system) using a World::run_system
can be significantly simpler and ensures that change detection and command flushing work as expected.
Borrow-checking is handled for you, allowing you to mutably access multiple compatible system parameters at once,
and arbitrary system parameters (like MessageWriter) can be conveniently fetched.
For an alternative approach to split mutable access to the world, see World::resource_scope.
§Warning
SystemState values created can be cached to improve performance,
and must be cached and reused in order for system parameters that rely on local state to work correctly.
These include:
Added,ChangedandSpawnedquery filtersLocalvariables that hold stateMessageReadersystem parameters, which rely on aLocalto track which messages have been seen
Note that this is automatically handled for you when using a World::run_system.
§Example
Basic usage:
// Work directly on the `World`
let mut world = World::new();
world.init_resource::<Messages<MyMessage>>();
// Construct a `SystemState` struct, passing in a tuple of `SystemParam`
// as if you were writing an ordinary system.
let mut system_state: SystemState<(
MessageWriter<MyMessage>,
Option<ResMut<MyResource>>,
Query<&MyComponent>,
)> = SystemState::new(&mut world);
// Use system_state.get_mut(&mut world) and unpack your system parameters into variables!
// system_state.get(&world) provides read-only versions of your system parameters instead.
let (message_writer, maybe_resource, query) = system_state.get_mut(&mut world).unwrap();
// If you are using `Commands`, you can choose when you want to apply them to the world.
// You need to manually call `.apply(world)` on the `SystemState` to apply them.Caching:
#[derive(Resource)]
struct CachedSystemState {
message_state: SystemState<MessageReader<'static, 'static, MyMessage>>,
}
// Create and store a system state once
let mut world = World::new();
world.init_resource::<Messages<MyMessage>>();
let initial_state: SystemState<MessageReader<MyMessage>> = SystemState::new(&mut world);
// The system state is cached in a resource
world.insert_resource(CachedSystemState {
message_state: initial_state,
});
// Later, fetch the cached system state, saving on overhead
world.resource_scope(|world, mut cached_state: Mut<CachedSystemState>| {
let mut message_reader = cached_state.message_state.get_mut(world).unwrap();
for message in message_reader.read() {
println!("Hello World!");
}
});Exclusive System:
fn exclusive_system(world: &mut World, system_state: &mut SystemState<MessageReader<MyMessage>>) {
let mut message_reader = system_state.get_mut(world).unwrap();
for message in message_reader.read() {
println!("Hello World!");
}
}Implementations§
Source§impl SystemState<()>
impl SystemState<()>
Sourcepub fn build_system<InnerOut, Out, Marker, F>(
self,
func: F,
) -> FunctionSystem<Marker, (), Out, F>where
InnerOut: IntoResult<Out>,
F: FnMut() -> InnerOut + SystemParamFunction<Marker, In = (), Out = InnerOut, Param = ()>,
pub fn build_system<InnerOut, Out, Marker, F>(
self,
func: F,
) -> FunctionSystem<Marker, (), Out, F>where
InnerOut: IntoResult<Out>,
F: FnMut() -> InnerOut + SystemParamFunction<Marker, In = (), Out = InnerOut, Param = ()>,
Create a FunctionSystem from a SystemState.
This method signature allows type inference of closure parameters for a system with no input.
You can use SystemState::build_system_with_input() if you have input, or SystemState::build_any_system() if you don’t need type inference.
Sourcepub fn build_system_with_input<InnerIn, In, InnerOut, Out, Marker, F>(
self,
func: F,
) -> FunctionSystem<Marker, In, Out, F>where
InnerIn: SystemInput + FromInput<In>,
In: SystemInput,
InnerOut: IntoResult<Out>,
F: FnMut(InnerIn) -> InnerOut + SystemParamFunction<Marker, In = InnerIn, Out = InnerOut, Param = ()>,
pub fn build_system_with_input<InnerIn, In, InnerOut, Out, Marker, F>(
self,
func: F,
) -> FunctionSystem<Marker, In, Out, F>where
InnerIn: SystemInput + FromInput<In>,
In: SystemInput,
InnerOut: IntoResult<Out>,
F: FnMut(InnerIn) -> InnerOut + SystemParamFunction<Marker, In = InnerIn, Out = InnerOut, Param = ()>,
Create a FunctionSystem from a SystemState.
This method signature allows type inference of closure parameters for a system with input.
You can use SystemState::build_system() if you have no input, or SystemState::build_any_system() if you don’t need type inference.
Source§impl<P> SystemState<(P₁, P₂, …, Pₙ)>where
P: SystemParam,
This trait is implemented for tuples up to 16 items long.
impl<P> SystemState<(P₁, P₂, …, Pₙ)>where
P: SystemParam,
This trait is implemented for tuples up to 16 items long.
Sourcepub fn build_system<InnerOut, Out, Marker, F>(
self,
func: F,
) -> FunctionSystem<Marker, (), Out, F>where
InnerOut: IntoResult<Out>,
F: FnMut(<P as SystemParam>::Item<'_, '_>) -> InnerOut + SystemParamFunction<Marker, In = (), Out = InnerOut, Param = (P,)>,
pub fn build_system<InnerOut, Out, Marker, F>(
self,
func: F,
) -> FunctionSystem<Marker, (), Out, F>where
InnerOut: IntoResult<Out>,
F: FnMut(<P as SystemParam>::Item<'_, '_>) -> InnerOut + SystemParamFunction<Marker, In = (), Out = InnerOut, Param = (P,)>,
Create a FunctionSystem from a SystemState.
This method signature allows type inference of closure parameters for a system with no input.
You can use SystemState::build_system_with_input() if you have input, or SystemState::build_any_system() if you don’t need type inference.
Sourcepub fn build_system_with_input<InnerIn, In, InnerOut, Out, Marker, F>(
self,
func: F,
) -> FunctionSystem<Marker, In, Out, F>where
InnerIn: SystemInput + FromInput<In>,
In: SystemInput,
InnerOut: IntoResult<Out>,
F: FnMut(InnerIn, <P as SystemParam>::Item<'_, '_>) -> InnerOut + SystemParamFunction<Marker, In = InnerIn, Out = InnerOut, Param = (P,)>,
pub fn build_system_with_input<InnerIn, In, InnerOut, Out, Marker, F>(
self,
func: F,
) -> FunctionSystem<Marker, In, Out, F>where
InnerIn: SystemInput + FromInput<In>,
In: SystemInput,
InnerOut: IntoResult<Out>,
F: FnMut(InnerIn, <P as SystemParam>::Item<'_, '_>) -> InnerOut + SystemParamFunction<Marker, In = InnerIn, Out = InnerOut, Param = (P,)>,
Create a FunctionSystem from a SystemState.
This method signature allows type inference of closure parameters for a system with input.
You can use SystemState::build_system() if you have no input, or SystemState::build_any_system() if you don’t need type inference.
Source§impl<Param> SystemState<Param>where
Param: SystemParam,
impl<Param> SystemState<Param>where
Param: SystemParam,
Sourcepub fn new(world: &mut World) -> SystemState<Param>
pub fn new(world: &mut World) -> SystemState<Param>
Creates a new SystemState with default state.
Examples found in repository?
66fn spawn_tasks(mut commands: Commands) {
67 let thread_pool = AsyncComputeTaskPool::get();
68 for x in 0..NUM_CUBES {
69 for y in 0..NUM_CUBES {
70 for z in 0..NUM_CUBES {
71 // Spawn new task on the AsyncComputeTaskPool; the task will be
72 // executed in the background, and the Task future returned by
73 // spawn() can be used to poll for the result
74 let entity = commands.spawn_empty().id();
75 let task = thread_pool.spawn(async move {
76 let duration = Duration::from_secs_f32(rand::rng().random_range(0.05..5.0));
77
78 // Pretend this is a time-intensive function. :)
79 Delay::new(duration).await;
80
81 // Such hard work, all done!
82 let transform = Transform::from_xyz(x as f32, y as f32, z as f32);
83 let mut command_queue = CommandQueue::default();
84
85 // we use a raw command queue to pass a FnOnce(&mut World) back to be
86 // applied in a deferred manner.
87 command_queue.push(move |world: &mut World| {
88 let (box_mesh_handle, box_material_handle) = {
89 let mut system_state = SystemState::<(
90 Res<BoxMeshHandle>,
91 Res<BoxMaterialHandle>,
92 )>::new(world);
93 let (box_mesh_handle, box_material_handle) =
94 system_state.get_mut(world).unwrap();
95
96 (box_mesh_handle.clone(), box_material_handle.clone())
97 };
98
99 world
100 .entity_mut(entity)
101 // Add our new `Mesh3d` and `MeshMaterial3d` to our tagged entity
102 .insert((
103 Mesh3d(box_mesh_handle),
104 MeshMaterial3d(box_material_handle),
105 transform,
106 ));
107 });
108
109 command_queue
110 });
111
112 // Add our new task as a component
113 commands.entity(entity).insert(ComputeTransform(task));
114 }
115 }
116 }
117}Sourcepub fn build_any_system<Marker, In, Out, F>(
self,
func: F,
) -> FunctionSystem<Marker, In, Out, F>where
In: SystemInput,
F: SystemParamFunction<Marker, Param = Param>,
<F as SystemParamFunction<Marker>>::In: FromInput<In>,
<F as SystemParamFunction<Marker>>::Out: IntoResult<Out>,
pub fn build_any_system<Marker, In, Out, F>(
self,
func: F,
) -> FunctionSystem<Marker, In, Out, F>where
In: SystemInput,
F: SystemParamFunction<Marker, Param = Param>,
<F as SystemParamFunction<Marker>>::In: FromInput<In>,
<F as SystemParamFunction<Marker>>::Out: IntoResult<Out>,
Create a FunctionSystem from a SystemState.
This method signature allows any system function, but the compiler will not perform type inference on closure parameters.
You can use SystemState::build_system() or SystemState::build_system_with_input() to get type inference on parameters.
Examples found in repository?
78fn stress_test(num_entities: u32, num_components: u32, num_systems: u32) {
79 let mut rng = ChaCha8Rng::seed_from_u64(42);
80 let mut app = App::default();
81 let world = app.world_mut();
82
83 // register a bunch of components
84 let component_ids: Vec<ComponentId> = (1..=num_components)
85 .map(|i| {
86 world.register_component_with_descriptor(
87 // SAFETY:
88 // * We don't implement a drop function
89 // * u8 is Sync and Send
90 unsafe {
91 ComponentDescriptor::new_with_layout(
92 format!("Component{i}").to_string(),
93 StorageType::Table,
94 Layout::new::<u8>(),
95 None,
96 true, // is mutable
97 false, // has no summary tick
98 ComponentCloneBehavior::Default,
99 None,
100 )
101 },
102 )
103 })
104 .collect();
105
106 // fill the schedule with systems
107 let mut schedule = Schedule::new(Update);
108 for _ in 1..=num_systems {
109 let num_access_components = rng.random_range(1..10);
110 let access_components: Vec<ComponentId> = component_ids
111 .sample(&mut rng, num_access_components)
112 .copied()
113 .collect();
114 let system = (QueryParamBuilder::new(|builder| {
115 for &access_component in &access_components {
116 if rand::random::<bool>() {
117 builder.mut_id(access_component);
118 } else {
119 builder.ref_id(access_component);
120 }
121 }
122 }),)
123 .build_state(world)
124 .build_any_system(base_system);
125 schedule.add_systems((move || access_components.clone()).pipe(system));
126 }
127
128 // spawn a bunch of entities
129 for _ in 1..=num_entities {
130 let num_components = rng.random_range(1..10);
131 let components: Vec<ComponentId> = component_ids
132 .sample(&mut rng, num_components)
133 .copied()
134 .collect();
135
136 let mut entity = world.spawn_empty();
137 // We use `ManuallyDrop` here as we need to avoid dropping the u8's when `values` is dropped
138 // since ownership of the values is passed to the world in `insert_by_ids`.
139 // But we do want to deallocate the memory when values is dropped.
140 let mut values: Vec<ManuallyDrop<u8>> = components
141 .iter()
142 .map(|_id| ManuallyDrop::new(rng.random_range(0..255)))
143 .collect();
144 let ptrs: Vec<OwningPtr> = values
145 .iter_mut()
146 .map(|value| {
147 // SAFETY:
148 // * We don't read/write `values` binding after this and values are `ManuallyDrop`,
149 // so we have the right to drop/move the values
150 unsafe { PtrMut::from(value).promote() }
151 })
152 .collect();
153 // SAFETY:
154 // * component_id's are from the same world
155 // * `values` was initialized above, so references are valid
156 unsafe {
157 entity.insert_by_ids(&components, ptrs.into_iter());
158 }
159 }
160
161 // overwrite Update schedule in the app
162 app.add_schedule(schedule);
163 app.add_plugins(MinimalPlugins)
164 .add_plugins(DiagnosticsPlugin)
165 .add_plugins(LogPlugin::default())
166 .add_plugins(FrameTimeDiagnosticsPlugin::default())
167 .add_plugins(LogDiagnosticsPlugin::filtered(HashSet::from_iter([
168 DiagnosticPath::new("fps"),
169 ])));
170 app.run();
171}Sourcepub fn meta(&self) -> &SystemMeta
pub fn meta(&self) -> &SystemMeta
Gets the metadata for this instance.
Sourcepub fn meta_mut(&mut self) -> &mut SystemMeta
pub fn meta_mut(&mut self) -> &mut SystemMeta
Gets the metadata for this instance.
Sourcepub fn get<'w, 's>(
&'s mut self,
world: &'w World,
) -> Result<<Param as SystemParam>::Item<'w, 's>, SystemParamValidationError>where
Param: ReadOnlySystemParam,
pub fn get<'w, 's>(
&'s mut self,
world: &'w World,
) -> Result<<Param as SystemParam>::Item<'w, 's>, SystemParamValidationError>where
Param: ReadOnlySystemParam,
Retrieve the SystemParam values. This can only be called when all parameters are read-only.
Returns an error if system parameter validation fails.
Sourcepub fn get_mut<'w, 's>(
&'s mut self,
world: &'w mut World,
) -> Result<<Param as SystemParam>::Item<'w, 's>, SystemParamValidationError>
pub fn get_mut<'w, 's>( &'s mut self, world: &'w mut World, ) -> Result<<Param as SystemParam>::Item<'w, 's>, SystemParamValidationError>
Retrieve the mutable SystemParam values.
Returns an error if system parameter validation fails.
Examples found in repository?
66fn spawn_tasks(mut commands: Commands) {
67 let thread_pool = AsyncComputeTaskPool::get();
68 for x in 0..NUM_CUBES {
69 for y in 0..NUM_CUBES {
70 for z in 0..NUM_CUBES {
71 // Spawn new task on the AsyncComputeTaskPool; the task will be
72 // executed in the background, and the Task future returned by
73 // spawn() can be used to poll for the result
74 let entity = commands.spawn_empty().id();
75 let task = thread_pool.spawn(async move {
76 let duration = Duration::from_secs_f32(rand::rng().random_range(0.05..5.0));
77
78 // Pretend this is a time-intensive function. :)
79 Delay::new(duration).await;
80
81 // Such hard work, all done!
82 let transform = Transform::from_xyz(x as f32, y as f32, z as f32);
83 let mut command_queue = CommandQueue::default();
84
85 // we use a raw command queue to pass a FnOnce(&mut World) back to be
86 // applied in a deferred manner.
87 command_queue.push(move |world: &mut World| {
88 let (box_mesh_handle, box_material_handle) = {
89 let mut system_state = SystemState::<(
90 Res<BoxMeshHandle>,
91 Res<BoxMaterialHandle>,
92 )>::new(world);
93 let (box_mesh_handle, box_material_handle) =
94 system_state.get_mut(world).unwrap();
95
96 (box_mesh_handle.clone(), box_material_handle.clone())
97 };
98
99 world
100 .entity_mut(entity)
101 // Add our new `Mesh3d` and `MeshMaterial3d` to our tagged entity
102 .insert((
103 Mesh3d(box_mesh_handle),
104 MeshMaterial3d(box_material_handle),
105 transform,
106 ));
107 });
108
109 command_queue
110 });
111
112 // Add our new task as a component
113 commands.entity(entity).insert(ComputeTransform(task));
114 }
115 }
116 }
117}Sourcepub fn apply(&mut self, world: &mut World)
pub fn apply(&mut self, world: &mut World)
Applies all state queued up for SystemParam values. For example, this will apply commands queued up
by a Commands parameter to the given World.
This function should be called manually after the values returned by SystemState::get and SystemState::get_mut
are finished being used.
Sourcepub fn matches_world(&self, world_id: WorldId) -> bool
pub fn matches_world(&self, world_id: WorldId) -> bool
Returns true if world_id matches the World that was used to call SystemState::new.
Otherwise, this returns false.
Sourcepub unsafe fn get_unchecked<'w, 's>(
&'s mut self,
world: UnsafeWorldCell<'w>,
) -> Result<<Param as SystemParam>::Item<'w, 's>, SystemParamValidationError>
pub unsafe fn get_unchecked<'w, 's>( &'s mut self, world: UnsafeWorldCell<'w>, ) -> Result<<Param as SystemParam>::Item<'w, 's>, SystemParamValidationError>
Retrieve the SystemParam values.
Returns an error if system parameter validation fails.
§Safety
This call might access any of the input parameters in a way that violates Rust’s mutability rules. Make sure the data
access is safe in the context of global World access. The passed-in World must be the World the SystemState was
created with.
Sourcepub fn param_state(&self) -> &<Param as SystemParam>::State
pub fn param_state(&self) -> &<Param as SystemParam>::State
Returns a reference to the current system param states.
Sourcepub unsafe fn param_state_mut(&mut self) -> &mut <Param as SystemParam>::State
pub unsafe fn param_state_mut(&mut self) -> &mut <Param as SystemParam>::State
Returns a mutable reference to the current system param states.
Marked as unsafe because modifying the system states may result in violation to certain
assumptions made by the SystemParam. Use with care.
§Safety
Modifying the system param states may have unintended consequences.
The param state is generally considered to be owned by the SystemParam. Modifications
should respect any invariants as required by the SystemParam.
For example, modifying the system state of ResMut will obviously create issues.
Trait Implementations§
Source§impl<Param> FromWorld for SystemState<Param>where
Param: SystemParam,
impl<Param> FromWorld for SystemState<Param>where
Param: SystemParam,
Source§fn from_world(world: &mut World) -> SystemState<Param>
fn from_world(world: &mut World) -> SystemState<Param>
Self using data from the given World.impl<P> ReadOnlySystemParam for &mut SystemState<P>where
P: SystemParam + 'static,
Source§impl<P> SystemParam for &mut SystemState<P>where
P: SystemParam + 'static,
impl<P> SystemParam for &mut SystemState<P>where
P: SystemParam + 'static,
Source§type State = SystemState<P>
type State = SystemState<P>
Source§type Item<'world, 'state> = &'state mut SystemState<P>
type Item<'world, 'state> = &'state mut SystemState<P>
Self, instantiated with new lifetimes. Read moreSource§fn init_state(world: &mut World) -> <&mut SystemState<P> as SystemParam>::State
fn init_state(world: &mut World) -> <&mut SystemState<P> as SystemParam>::State
State.Source§fn init_access(
_state: &<&mut SystemState<P> as SystemParam>::State,
_system_meta: &mut SystemMeta,
_system_access: &mut SystemAccess,
_world: &mut World,
)
fn init_access( _state: &<&mut SystemState<P> as SystemParam>::State, _system_meta: &mut SystemMeta, _system_access: &mut SystemAccess, _world: &mut World, )
Source§unsafe fn get_param<'world, 'state>(
state: &'state mut <&mut SystemState<P> as SystemParam>::State,
_system_meta: &SystemMeta,
_world: UnsafeWorldCell<'world>,
_change_tick: Tick,
) -> Result<<&mut SystemState<P> as SystemParam>::Item<'world, 'state>, SystemParamValidationError>
unsafe fn get_param<'world, 'state>( state: &'state mut <&mut SystemState<P> as SystemParam>::State, _system_meta: &SystemMeta, _world: UnsafeWorldCell<'world>, _change_tick: Tick, ) -> Result<<&mut SystemState<P> as SystemParam>::Item<'world, 'state>, SystemParamValidationError>
SystemParamFunction. Read moreSource§fn apply(state: &mut Self::State, system_meta: &SystemMeta, world: &mut World)
fn apply(state: &mut Self::State, system_meta: &SystemMeta, world: &mut World)
SystemParam’s state.
This is used to apply Commands during ApplyDeferred.Source§fn queue(
state: &mut Self::State,
system_meta: &SystemMeta,
world: DeferredWorld<'_>,
)
fn queue( state: &mut Self::State, system_meta: &SystemMeta, world: DeferredWorld<'_>, )
ApplyDeferred.Auto Trait Implementations§
impl<Param> !RefUnwindSafe for SystemState<Param>
impl<Param> !UnwindSafe for SystemState<Param>
impl<Param> Freeze for SystemState<Param>
impl<Param> Send for SystemState<Param>
impl<Param> Sync for SystemState<Param>
impl<Param> Unpin for SystemState<Param>
impl<Param> UnsafeUnpin for SystemState<Param>
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<GpuImage>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ConditionalSend for Twhere
T: Send,
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>, which can then be
downcast into Box<dyn 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>, which 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> 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> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<T> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
Source§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
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 moreSource§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
Source§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
Source§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
impl<T> Settings for T
Source§impl<Ret> SpawnIfAsync<(), Ret> for Ret
impl<Ret> SpawnIfAsync<(), Ret> for Ret
Source§impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
Source§fn super_from(input: T) -> O
fn super_from(input: T) -> O
Source§impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
Source§fn super_into(self) -> O
fn super_into(self) -> O
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.