Skip to main content

LogBlock

Struct LogBlock 

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

§Log Block

This object represent an IDLE LogBlock in the Crazyflie.

If the LogBlock object is dropped or its associated LogStream, the Log Block will be deleted in the Crazyflie freeing resources.

See the log module documentation for more context and information.

Implementations§

Source§

impl LogBlock

Source

pub async fn start(self, period: LogPeriod) -> Result<LogStream>

Start log block and return a stream to read the value

Since a log-block cannot be modified after being started, this function consumes the LogBlock object and return a LogStream. The function LogStream::stop() can be called on the LogStream to get back the LogBlock object.

This function can fail if there is a protocol error or an error reported by the Crazyflie. In such case, the LogBlock object will be dropped and the block will be deleted in the Crazyflie

Source

pub async fn add_variable(&mut self, name: &str) -> Result<()>

Add a variable to the log block

A packet will be sent to the Crazyflie to add the variable. The variable is logged in the same format as it is stored in the Crazyflie (ie. there is no conversion done)

This function can fail if the variable is not found in the toc or of the Crazyflie returns an error The most common error reported by the Crazyflie would be if the log block is already too full.

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.