opentitanlib::util::testing

Struct ChildUart

Source
pub struct ChildUart { /* private fields */ }

Implementations§

Source§

impl ChildUart

Source

pub fn spawn_corrupt<S: AsRef<OsStr>>( argv: &[S], rd: TransferState, wr: TransferState, ) -> Result<Self>

Source

pub fn spawn<S: AsRef<OsStr>>(argv: &[S]) -> Result<Self>

Source

pub fn wait(&self) -> Result<ExitStatus>

Trait Implementations§

Source§

impl Uart for ChildUart

Source§

fn get_baudrate(&self) -> Result<u32>

Returns the UART baudrate. May return zero for virtual UARTs.
Source§

fn set_baudrate(&self, _baudrate: u32) -> Result<()>

Sets the UART baudrate. May do nothing for virtual UARTs.
Source§

fn read_timeout(&self, _buf: &mut [u8], _timeout: Duration) -> Result<usize>

Reads UART receive data into buf, returning the number of bytes read. The timeout may be used to specify a duration to wait for data. If timeout expires without any data arriving Ok(0) will be returned, never Err(_).
Source§

fn read(&self, buf: &mut [u8]) -> Result<usize>

Reads UART receive data into buf, returning the number of bytes read. This function may block.
Source§

fn write(&self, buf: &[u8]) -> Result<()>

Writes data from buf to the UART.
Source§

fn set_flow_control(&self, flow_control: bool) -> Result<()>

Enables software flow control for writes.
Source§

fn get_device_path(&self) -> Result<String>

Returns "/dev/ttyUSBn" or similar OS device path usable by external programs for directly accessing the serial port.
Source§

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

Clears the UART RX buffer.
Source§

fn set_break(&self, _enable: bool) -> Result<()>

Source§

fn set_parity(&self, _parity: Parity) -> Result<()>

Source§

fn supports_nonblocking_read(&self) -> Result<bool>

Query if nonblocking mio mode is supported.
Source§

fn register_nonblocking_read( &self, _registry: &Registry, _token: Token, ) -> Result<()>

Switch this Uart instance into nonblocking mio mode. Going forward, read() should only be called after mio::poll() has indicated that the given Token is ready.
Source§

fn nonblocking_help(&self) -> Result<Rc<dyn NonblockingHelp>>

Get the same single NonblockingHelp object as from top level Transport.nonblocking_help().

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V