Trait Transport

Source
pub trait Transport {
Show 14 methods // Required method fn capabilities(&self) -> Result<Capabilities>; // Provided methods fn apply_default_configuration(&self) -> Result<()> { ... } fn jtag(&self, _opts: &JtagParams) -> Result<Box<dyn JtagChain + '_>> { ... } fn spi(&self, _instance: &str) -> Result<Rc<dyn Target>> { ... } fn i2c(&self, _instance: &str) -> Result<Rc<dyn Bus>> { ... } fn uart(&self, _instance: &str) -> Result<Rc<dyn Uart>> { ... } fn gpio_pin(&self, _instance: &str) -> Result<Rc<dyn GpioPin>> { ... } fn gpio_monitoring(&self) -> Result<Rc<dyn GpioMonitoring>> { ... } fn gpio_bitbanging(&self) -> Result<Rc<dyn GpioBitbanging>> { ... } fn emulator(&self) -> Result<&dyn Emulator> { ... } fn fpga_ops(&self) -> Result<&dyn FpgaOps> { ... } fn proxy_ops(&self) -> Result<&dyn ProxyOps> { ... } fn dispatch(&self, _action: &dyn Any) -> Result<Option<Box<dyn Serialize>>> { ... } fn relinquish_exclusive_access( &self, callback: Box<dyn FnOnce() + '_>, ) -> Result<()> { ... }
}
Expand description

A transport object is a factory for the low-level interfaces provided by a given communications backend.

Required Methods§

Source

fn capabilities(&self) -> Result<Capabilities>

Returns a Capabilities object to check the capabilities of this transport object.

Provided Methods§

Source

fn apply_default_configuration(&self) -> Result<()>

Resets the transport to power-on condition. That is, pin/uart/spi configuration reverts to default, ongoing operations are cancelled, etc.

Source

fn jtag(&self, _opts: &JtagParams) -> Result<Box<dyn JtagChain + '_>>

Returns a JtagChain implementation.

Source

fn spi(&self, _instance: &str) -> Result<Rc<dyn Target>>

Returns a SPI Target implementation.

Source

fn i2c(&self, _instance: &str) -> Result<Rc<dyn Bus>>

Returns a I2C Bus implementation.

Source

fn uart(&self, _instance: &str) -> Result<Rc<dyn Uart>>

Returns a Uart implementation.

Source

fn gpio_pin(&self, _instance: &str) -> Result<Rc<dyn GpioPin>>

Returns a GpioPin implementation.

Source

fn gpio_monitoring(&self) -> Result<Rc<dyn GpioMonitoring>>

Returns a GpioMonitoring implementation, for logic analyzer functionality.

Source

fn gpio_bitbanging(&self) -> Result<Rc<dyn GpioBitbanging>>

Returns a GpioBitbanging implementation, for timed and synchronized manipulation of multiple GPIO pins.

Source

fn emulator(&self) -> Result<&dyn Emulator>

Returns a Emulator implementation.

Source

fn fpga_ops(&self) -> Result<&dyn FpgaOps>

Methods available only on FPGA implementations.

Source

fn proxy_ops(&self) -> Result<&dyn ProxyOps>

Methods available only on Proxy implementation.

Source

fn dispatch(&self, _action: &dyn Any) -> Result<Option<Box<dyn Serialize>>>

Invoke non-standard functionality of some Transport implementations.

Source

fn relinquish_exclusive_access( &self, callback: Box<dyn FnOnce() + '_>, ) -> Result<()>

Invoke the provided callback (preferably) without exclusive access.

By default, ownership of Transport would imply exclusive access to the underlying device, and optimisation can be made assuming no other process would be simultaneously accessing. However for long running commands, such as opentitantool console, it may be desirable to relinquish exclusive access during such comamnd and only re-take exclusive access later.

Transport that does not support such scenario may ignore such request and perform a no-op.

Implementors§