pub struct HalComponent<R> { /* private fields */ }
Expand description

HAL component

The main HAL component interface. See the crate documentation for examples.

During registraton, all resource names are prefixed with the component name and a . full stop character. For example, a component named rust-comp with a pin named input-1 will show up in LinuxCNC as a pin called rust-comp.input-1.

HalComponent has a custom Drop implementation which calls hal_exit (among other things) when the variable holding the component goes out of scope. Due to this, the component should be initialised in main() so it lives for the entire life of the program.

Implementations

Create a new HAL component

new registers a new HAL component with LinuxCNC, registers the required UNIX signal handlers and allocates resources (pins, signals, etc) required by the component.

Get the HAL-assigned ID for this component

Get the component name

Check whether the component was signalled to shut down

Get a reference to the component’s resources

Trait Implementations

Formats the value using the given formatter. Read more

Clean up resources, signals and HAL component

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.