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

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

Reset the device.

Returns the current I/O mode.

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;

Retrieve the device’s current control bits.

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.

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.

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

Unique protocol identifier.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.