Struct SerialWrapper

Source
pub struct SerialWrapper<T: Trigger, EV: SerialEvents> {
    pub serial: Serial<T, EV, AdapterWriter>,
    pub out: Arc<Mutex<Option<Box<dyn Write + Send>>>>,
}

Fields§

§serial: Serial<T, EV, AdapterWriter>§out: Arc<Mutex<Option<Box<dyn Write + Send>>>>

Implementations§

Source§

impl SerialWrapper<EventFdTrigger, SerialEventsWrapper>

Source

pub fn new(event: EventFd) -> Self

Creates a new SerialDevice instance.

Trait Implementations§

Source§

impl ConsoleHandler for SerialWrapper<EventFdTrigger, SerialEventsWrapper>

Source§

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

Send raw input to this emulated device.
Source§

fn set_output_stream(&mut self, out: Option<Box<dyn Write + Send>>)

Set the stream to receive raw output from this emulated device.
Source§

impl DeviceIoMut for SerialWrapper<EventFdTrigger, SerialEventsWrapper>

Source§

fn pio_read(&mut self, _base: PioAddress, offset: PioAddress, data: &mut [u8])

Read from port base + offset into data.
Source§

fn pio_write(&mut self, _base: PioAddress, offset: PioAddress, data: &[u8])

Write from data to the port base + offset.
Source§

fn read(&mut self, _base: IoAddress, offset: IoAddress, data: &mut [u8])

Read from the MMIO address base + offset into data.
Source§

fn write(&mut self, _base: IoAddress, offset: IoAddress, data: &[u8])

Write from data to the MMIO address base + offset.
Source§

fn get_assigned_resources(&self) -> DeviceResources

Get resources assigned to the device.
Source§

fn get_trapped_io_resources(&self) -> DeviceResources

Get the trapped IO address ranges for the device. Read more

Auto Trait Implementations§

§

impl<T, EV> Freeze for SerialWrapper<T, EV>
where T: Freeze, EV: Freeze,

§

impl<T, EV> RefUnwindSafe for SerialWrapper<T, EV>

§

impl<T, EV> Send for SerialWrapper<T, EV>
where T: Send, EV: Send,

§

impl<T, EV> Sync for SerialWrapper<T, EV>
where T: Sync, EV: Sync,

§

impl<T, EV> Unpin for SerialWrapper<T, EV>
where T: Unpin, EV: Unpin,

§

impl<T, EV> UnwindSafe for SerialWrapper<T, EV>
where T: UnwindSafe, EV: UnwindSafe,

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, 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.