Console

Struct Console 

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

§Access to the console subsystem

See the console module documentation for more context and information.

Implementations§

Source§

impl Console

Source

pub async fn stream(&self) -> impl Stream<Item = String> + use<>

Return a Stream that generates a String each time a console packet is received from the Crazyflie.

With the current Crazyflie algorithms, packets are up to 30 character long and a new line triggers the send of a packet. Though this is not a guarantee and nothing should be expected from this Stream other that getting the console data when they are received.

The lib keeps track of the console history since connection, the stream will first produce the full history since connection in one String and then will start returning Strings as they come from the Crazyflie.

Source

pub async fn stream_no_history(&self) -> impl Stream<Item = String> + use<>

Version of Console::stream() but that does not produce the history first.

Source

pub async fn line_stream(&self) -> impl Stream<Item = String> + use<>

Return a Stream that generate a String each time a line is received from the Crazyflie.

This is a useful function if you want to receive the console line by line. (for example to print it in a terminal or a file)

Similar to Console::stream(), this stream will generate first the console history since connection. The history is generated by the Stream line-by-line.

Source

pub async fn line_stream_no_history(&self) -> impl Stream<Item = String> + use<>

Version of Console::line_stream() but that does not produce the history first.

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.