[][src]Struct rtt_target::UpChannel

pub struct UpChannel(_);

RTT up (target to host) channel

Supports writing binary data directly, or writing strings via core::fmt macros such as write as well as the ufmt crate's uwrite macros (use the u method).

Note that the formatted writing implementations diverge slightly from the trait definitions in that if the channel is in non-blocking mode, writing will not block.

Methods

impl UpChannel[src]

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

Writes buf to the channel and returns the number of bytes written. Behavior when the buffer is full is subject to the channel blocking mode.

pub fn u(&mut self) -> uWriter[src]

Creates a writer for formatted writing with ufmt.

The correct way to use this method is to call it once for each write operation. This is so that non blocking modes will work correctly.

let mut output = channels.up.0;
uwriteln!(output.u(), "Hello, ufmt!");

pub fn mode(&self) -> ChannelMode[src]

Gets the current blocking mode of the channel. The default is NoBlockSkip.

pub fn set_mode(&mut self, mode: ChannelMode)[src]

Sets the blocking mode of the channel

pub fn into_terminal(self) -> TerminalChannel[src]

Converts the channel into a virtual terminal that can be used for writing into multiple virtual terminals.

Trait Implementations

impl Send for UpChannel[src]

impl Write for UpChannel[src]

Auto Trait Implementations

impl !Sync for UpChannel

impl Unpin for UpChannel

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> Same<T> for T

type Output = T

Should always be Self

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.