[−][src]Struct linuxcnc_hal::HalComponentBuilder
HAL component builder
Create a new HAL component with HalComponentBuilder::new. Use the builder to register a
component with LinuxCNC. Once created, pins can be registered to the component. Finally, call
builder.ready() to consume the builder and create a HalComponent ready for use in the
component main loop.
Methods
impl HalComponentBuilder[src]
pub fn new(name: &'static str) -> Result<Self, ComponentInitError>[src]
Create a new HAL component builder and begin initialisation
Safety
This calls hal_init internally, which may panic or leak memory.
Errors
This component will error if the component name is longer than HAL_NAME_LEN, the name
cannot be converted to a valid CString or the call to hal_init returns an invalid
ID.
pub fn register_input_pin<P>(
&mut self,
pin_name: &'static str
) -> Result<InputPin<P>, PinRegisterError> where
P: HalPin + 'static, [src]
&mut self,
pin_name: &'static str
) -> Result<InputPin<P>, PinRegisterError> where
P: HalPin + 'static,
Register an input pin with this component
The pin name will be prefixed with the component name
pub fn register_output_pin<P>(
&mut self,
pin_name: &'static str
) -> Result<OutputPin<P>, PinRegisterError> where
P: HalPin + 'static, [src]
&mut self,
pin_name: &'static str
) -> Result<OutputPin<P>, PinRegisterError> where
P: HalPin + 'static,
Register an output pin with this component
The pin name will be prefixed with the component name
pub fn ready(self) -> Result<HalComponent, ComponentReadyError>[src]
Consume the builder and signal that the component is ready
This method is called after any pins are registered and consumes the builder into a
HalComponent.
Safety
This method calls the unsafe hal_ready method internally.
pub fn id(&self) -> i32[src]
Get the HAL-assigned ID for this component
pub fn name(&self) -> &str[src]
Get the component name
Trait Implementations
impl Debug for HalComponentBuilder[src]
impl PartialEq<HalComponentBuilder> for HalComponentBuilder[src]
fn eq(&self, other: &HalComponentBuilder) -> bool[src]
fn ne(&self, other: &HalComponentBuilder) -> bool[src]
impl StructuralPartialEq for HalComponentBuilder[src]
Auto Trait Implementations
impl RefUnwindSafe for HalComponentBuilder
impl Send for HalComponentBuilder
impl Sync for HalComponentBuilder
impl Unpin for HalComponentBuilder
impl UnwindSafe for HalComponentBuilder
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,