Trait stepper_lib::comp::tool::Tool

source ·
pub trait Tool: Debug {
Show 13 methods // Required methods fn mount(&mut self); fn dismount(&mut self); fn get_json(&self) -> Value; fn vec(&self) -> Vec3; fn inertia(&self) -> Inertia; fn mass(&self) -> f32; // Provided methods fn simple_tool(&self) -> Option<&dyn SimpleTool> { ... } fn simple_tool_mut(&mut self) -> Option<&mut dyn SimpleTool> { ... } fn axis_tool(&self) -> Option<&dyn AxisTool> { ... } fn axis_tool_mut(&mut self) -> Option<&mut dyn AxisTool> { ... } fn spindle_tool(&self) -> Option<&dyn SpindleTool> { ... } fn spindle_tool_mut(&mut self) -> Option<&mut dyn SpindleTool> { ... } fn get_type_name(&self) -> &str { ... }
}
Expand description

General tool trait

Required Methods§

source

fn mount(&mut self)

Mounts the component.

Comparable to a “setup” / “activate” function

source

fn dismount(&mut self)

Dismounts the component.

Comparable to a “deactivate” function

source

fn get_json(&self) -> Value

Returns the tool described as JSON-Object

source

fn vec(&self) -> Vec3

Returns the characteristic vector of the tool

source

fn inertia(&self) -> Inertia

Returns the tool inhertia

source

fn mass(&self) -> f32

Return the tool mass

Provided Methods§

source

fn simple_tool(&self) -> Option<&dyn SimpleTool>

Upgrade the tool to a SimpleTool if possible, returns None otherwise

source

fn simple_tool_mut(&mut self) -> Option<&mut dyn SimpleTool>

Upgrade the tool to a SimpleTool if possible, returns None otherwise

source

fn axis_tool(&self) -> Option<&dyn AxisTool>

Upgrade the tool to an AxisTool if possible, returns None otherwise

source

fn axis_tool_mut(&mut self) -> Option<&mut dyn AxisTool>

Upgrade the tool to an AxisTool if possible, returns None otherwise

source

fn spindle_tool(&self) -> Option<&dyn SpindleTool>

Upgrade the tool to an SpindleTool if possible, returns None otherwise

source

fn spindle_tool_mut(&mut self) -> Option<&mut dyn SpindleTool>

Upgrade the tool to an SpindleTool if possible, returns None otherwise

source

fn get_type_name(&self) -> &str

Returns the type name of the tool

Implementors§