pub trait InputMap: Send {
type CreationData: Clone + Send;
type Error: Into<EventFactoryError> + Send + 'static;
// Required method
fn func_for_input(
name: &str,
data: Self::CreationData,
) -> Result<ValueGetter<Self, Self::Error>, Self::Error>;
}
Expand description
This trait provides functionality to parse a type into an event.
For that, getter functions for the different input streams are provided through the func_for_input
method.
Note: The AssociatedEventFactory trait is automatically implemented for all types that implement this trait.
Required Associated Types§
Sourcetype CreationData: Clone + Send
type CreationData: Clone + Send
Arbitrary type of the data provided at creation time to help initializing the input method.
Sourcetype Error: Into<EventFactoryError> + Send + 'static
type Error: Into<EventFactoryError> + Send + 'static
The error returned if anything goes wrong.
Required Methods§
Sourcefn func_for_input(
name: &str,
data: Self::CreationData,
) -> Result<ValueGetter<Self, Self::Error>, Self::Error>
fn func_for_input( name: &str, data: Self::CreationData, ) -> Result<ValueGetter<Self, Self::Error>, Self::Error>
Given the name of an input this function returns a function that given self returns the value for that input.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.