Unit

Trait Unit 

Source
pub trait Unit {
    // Required methods
    fn poll(&mut self, ctx: &Context) -> UnitStatus;
    fn text_info(&self, ctx: &Context) -> String;
    fn connect(&mut self, ctx: &Context, mode: Unsigned12Bit);
    fn disconnect(&mut self, ctx: &Context);
    fn transfer_mode(&self) -> TransferMode;
    fn read(
        &mut self,
        ctx: &Context,
        diagnostics: &CurrentInstructionDiagnostics,
    ) -> Result<MaskedWord, TransferFailed>;
    fn write(
        &mut self,
        ctx: &Context,
        source: Unsigned36Bit,
        diagnostics: &CurrentInstructionDiagnostics,
    ) -> Result<Option<OutputEvent>, TransferFailed>;
    fn name(&self) -> String;
    fn on_input_event(
        &mut self,
        ctx: &Context,
        event: InputEvent,
    ) -> Result<InputFlagRaised, InputEventError>;
}

Required Methods§

Source

fn poll(&mut self, ctx: &Context) -> UnitStatus

Query the status of the unit.

Source

fn text_info(&self, ctx: &Context) -> String

Provide a text summary of the state of the device.

Source

fn connect(&mut self, ctx: &Context, mode: Unsigned12Bit)

Connect the unit.

Source

fn disconnect(&mut self, ctx: &Context)

Disconnect the unit.

Source

fn transfer_mode(&self) -> TransferMode

Query the TransferMode of the unit.

Source

fn read( &mut self, ctx: &Context, diagnostics: &CurrentInstructionDiagnostics, ) -> Result<MaskedWord, TransferFailed>

Handle a TSD on an input channel.

Source

fn write( &mut self, ctx: &Context, source: Unsigned36Bit, diagnostics: &CurrentInstructionDiagnostics, ) -> Result<Option<OutputEvent>, TransferFailed>

Handle a TSD on an output channel.

Source

fn name(&self) -> String

Query the name of the unit.

Source

fn on_input_event( &mut self, ctx: &Context, event: InputEvent, ) -> Result<InputFlagRaised, InputEventError>

Announce an input event for a unit.

Implementors§