[][src]Struct uefi::proto::console::serial::Serial

#[repr(C)]pub struct Serial<'boot> { /* fields omitted */ }

Provides access to a serial I/O device.

This can include standard UART devices, serial ports over a USB interface, or any other character-based communication device.

Since UEFI drivers are implemented through polling, if you fail to regularly check for input/output, some data might be lost.

Implementations

impl<'boot> Serial<'boot>[src]

pub fn reset(&mut self) -> Result[src]

Reset the device.

pub fn io_mode(&self) -> &IoMode[src]

Returns the current I/O mode.

pub fn set_attributes(&mut self, mode: &IoMode) -> Result[src]

Sets the device's new attributes.

The given IoMode will become the device's new IoMode, with some exceptions:

  • control_mask is ignored, since it's a read-only field;

  • values set to 0 / Default will be filled with the device's default parameters

  • if either baud_rate or receive_fifo_depth is less than the device's minimum, an error will be returned; this value will be rounded down to the nearest value supported by the device;

pub fn get_control_bits(&self) -> Result<ControlBits>[src]

Retrieve the device's current control bits.

pub fn set_control_bits(&mut self, bits: ControlBits) -> Result[src]

Sets the device's new control bits.

Not all bits can be modified with this function. A mask of the allowed bits is stored in the ControlBits::SETTABLE constant.

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

Reads data from this device.

This operation will block until the buffer has been filled with data or an error occurs. In the latter case, the error will indicate how many bytes were actually read from the device.

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

Writes data to this device.

This operation will block until the data has been fully written or an error occurs. In the latter case, the error will indicate how many bytes were actually written to the device.

Trait Implementations

impl<'boot> Identify for Serial<'boot>[src]

impl<'boot> Protocol for Serial<'boot>[src]

impl<'boot> !Send for Serial<'boot>[src]

impl<'boot> !Sync for Serial<'boot>[src]

Auto Trait Implementations

impl<'boot> Unpin for Serial<'boot>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.