pub struct FunctionSystem<Marker, F>where
F: SystemParamFunction<Marker>,{ /* private fields */ }Expand description
A system that wraps a function and its cached parameter state.
FunctionSystem stores:
- The function to call
- Cached state for each parameter
- Metadata (name, access patterns)
This type is created automatically when you call .into_system() on a
function. You typically don’t construct it directly.
§Type Parameters
Marker: A type-level marker to distinguish different function aritiesF: The function type
§Example
use goud_engine::ecs::{World, Component};
use goud_engine::ecs::system::{IntoSystem, BoxedSystem};
fn my_system() {
println!("Hello from system!");
}
let boxed: BoxedSystem = my_system.into_system();
assert_eq!(boxed.name(), "my_system");Implementations§
Source§impl<Marker, F> FunctionSystem<Marker, F>where
F: SystemParamFunction<Marker>,
impl<Marker, F> FunctionSystem<Marker, F>where
F: SystemParamFunction<Marker>,
Trait Implementations§
Source§impl<Marker, F> Debug for FunctionSystem<Marker, F>where
F: SystemParamFunction<Marker>,
impl<Marker, F> Debug for FunctionSystem<Marker, F>where
F: SystemParamFunction<Marker>,
Source§impl<Marker, F> System for FunctionSystem<Marker, F>
impl<Marker, F> System for FunctionSystem<Marker, F>
Source§fn component_access(&self) -> Access
fn component_access(&self) -> Access
Returns the component access pattern for this system. Read more
Source§fn initialize(&mut self, world: &mut World)
fn initialize(&mut self, world: &mut World)
Called once when the system is first added to a scheduler. Read more
Source§fn is_read_only(&self) -> bool
fn is_read_only(&self) -> bool
Returns true if this system only reads data. Read more
Auto Trait Implementations§
impl<Marker, F> Freeze for FunctionSystem<Marker, F>
impl<Marker, F> RefUnwindSafe for FunctionSystem<Marker, F>
impl<Marker, F> Send for FunctionSystem<Marker, F>
impl<Marker, F> Sync for FunctionSystem<Marker, F>where
F: Sync,
impl<Marker, F> Unpin for FunctionSystem<Marker, F>
impl<Marker, F> UnsafeUnpin for FunctionSystem<Marker, F>
impl<Marker, F> UnwindSafe for FunctionSystem<Marker, F>
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
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
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>
Converts
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>
Converts
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<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<S> IntoSystem for Swhere
S: System + 'static,
impl<S> IntoSystem for Swhere
S: System + 'static,
Source§fn into_system(self) -> BoxedSystem
fn into_system(self) -> BoxedSystem
Converts this into a system.