Struct UartDebugWriter

Source
pub struct UartDebugWriter { /* private fields */ }
Expand description

Buffered DebugWriter implementation using a UART.

Currently used as a default implementation of DebugWriterComponent.

Implementations§

Source§

impl UartDebugWriter

Source

pub fn new( uart: &'static dyn Transmit<'_>, out_buffer: &'static mut [u8], internal_buffer: &'static mut RingBuffer<'static, u8>, ) -> UartDebugWriter

Trait Implementations§

Source§

impl DebugWriter for UartDebugWriter

Source§

fn write(&self, bytes: &[u8], overflow_message: &[u8]) -> usize

Write bytes to output with overflow notification. Read more
Source§

fn publish(&self) -> usize

Publish bytes from the internal buffer to the output. Read more
Source§

fn flush(&self, writer: &mut dyn IoWrite)

Flush any buffered bytes to the provided output writer. Read more
Source§

fn available_len(&self) -> usize

Available length of the internal buffer if limited. Read more
Source§

fn to_write_len(&self) -> usize

How many bytes are buffered and not yet written.
Source§

impl IoWrite for UartDebugWriter

Source§

fn write(&mut self, bytes: &[u8]) -> usize

Source§

fn write_ring_buffer(&mut self, buf: &RingBuffer<'_, u8>) -> usize

Source§

impl TransmitClient for UartDebugWriter

Source§

fn transmitted_buffer( &self, buffer: &'static mut [u8], _tx_len: usize, _rcode: Result<(), ErrorCode>, )

Source§

fn transmitted_word(&self, _rcode: Result<(), ErrorCode>)

A call to Transmit::transmit_word completed. Read more

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