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
impl Console
Sourcepub async fn stream(&self) -> impl Stream<Item = String> + use<>
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.
Sourcepub async fn stream_no_history(&self) -> impl Stream<Item = String> + use<>
pub async fn stream_no_history(&self) -> impl Stream<Item = String> + use<>
Version of Console::stream() but that does not produce the history first.
Sourcepub async fn line_stream(&self) -> impl Stream<Item = String> + use<>
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.
Sourcepub async fn line_stream_no_history(&self) -> impl Stream<Item = String> + use<>
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.