Struct flo::tools::GenericTool
[−]
[src]
pub struct GenericTool<ToolData: Send + 'static, Model: Send + Sync + 'static, Anim: Animation, UnderlyingTool: Tool<Anim, ToolData = ToolData, Model = Model>> { /* fields omitted */ }
The generic tool is used to convert a tool that uses a specific data type to one that uses a standard data type. This makes it possible to use tools without needing to know their underlying implementation.
A generic tool is typically used as its underlying Tool trait, for example
in an Arc
reference.
Trait Implementations
impl<ToolData: Send + 'static, Model: Send + Sync + 'static, Anim: Animation, UnderlyingTool: Tool<Anim, ToolData = ToolData, Model = Model>> From<UnderlyingTool> for GenericTool<ToolData, Model, Anim, UnderlyingTool>
[src]
fn from(
tool: UnderlyingTool
) -> GenericTool<ToolData, Model, Anim, UnderlyingTool>
[src]
tool: UnderlyingTool
) -> GenericTool<ToolData, Model, Anim, UnderlyingTool>
Performs the conversion.
impl<ToolData: Send + Sync + 'static, Model: Send + Sync + 'static, Anim: Animation, UnderlyingTool: Tool<Anim, ToolData = ToolData, Model = Model>> Tool<Anim> for GenericTool<ToolData, Model, Anim, UnderlyingTool>
[src]
type ToolData = GenericToolData
Represents data for the tool at a point in time (typically a snapshot of the model) Read more
type Model = GenericToolModel
The type of the model used by the UI elements of this tool Read more
fn tool_name(&self) -> String
[src]
Retrieves the name of this tool Read more
fn image_name(&self) -> String
[src]
Retrieves the name of the image that is associated with this tool Read more
fn create_model(&self, flo_model: Arc<FloModel<Anim>>) -> GenericToolModel
[src]
Creates a new instance of the UI model for this tool Read more
[src]
Creates the menu controller for this tool (or None if this tool has no menu controller) Read more
ⓘImportant traits for Box<W>fn actions_for_model(
&self,
flo_model: Arc<FloModel<Anim>>,
tool_model: &GenericToolModel
) -> Box<Stream<Item = ToolAction<GenericToolData>, Error = ()> + Send>
[src]
&self,
flo_model: Arc<FloModel<Anim>>,
tool_model: &GenericToolModel
) -> Box<Stream<Item = ToolAction<GenericToolData>, Error = ()> + Send>
Returns a stream of tool actions that result from changes to the model Read more
ⓘImportant traits for Box<W>fn actions_for_input<'a>(
&'a self,
data: Option<Arc<GenericToolData>>,
input: Box<Iterator<Item = ToolInput<GenericToolData>> + 'a>
) -> Box<Iterator<Item = ToolAction<GenericToolData>> + 'a>
[src]
&'a self,
data: Option<Arc<GenericToolData>>,
input: Box<Iterator<Item = ToolInput<GenericToolData>> + 'a>
) -> Box<Iterator<Item = ToolAction<GenericToolData>> + 'a>
Converts a set of tool inputs into the corresponding actions that should be performed Read more