Skip to main content

Serial

Struct Serial 

Source
pub struct Serial {
    initialized: AtomicBool,
    base_addr: u16,
}
Expand description

x86_64 UART serial port implementing _Serial; do not write() before init().

Fields§

§initialized: AtomicBool§base_addr: u16

I/O base address for this COM port (e.g., 0x03F8 for COM1).

Trait Implementations§

Source§

impl _Serial for Serial

Source§

fn new(port: SerialPort) -> Self

Create a new (uninitialized) serial port instance for the given COM port.
Source§

fn init(&self) -> Result<(), &'static str>

Program the UART hardware and mark the port ready; Err if already initialized.
Source§

fn write(&self, string: &str)

Write all bytes of string to the port, blocking until each is accepted.

Auto Trait Implementations§

§

impl !Freeze for Serial

§

impl RefUnwindSafe for Serial

§

impl Send for Serial

§

impl Sync for Serial

§

impl Unpin for Serial

§

impl UnsafeUnpin for Serial

§

impl UnwindSafe for Serial

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

fn into(self) -> U

Calls U::from(self).

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

§

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

§

type Error = Infallible

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

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

Performs the conversion.
§

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

§

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

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

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

Performs the conversion.