ev3_drivebase/drivebase/
wait.rs

1#![expect(unused)]
2
3use super::DriveBase;
4use core::time::Duration;
5use ev3dev_lang_rust::motors::TachoMotor;
6
7impl DriveBase {
8    /// Wait until condition cond returns true or the timeout is reached.
9    ///
10    /// The condition is checked when to the state attribute has changed. If the timeout is None
11    /// it will wait an infinite amount of time.
12    pub fn wait<F>(&self, cond: F, timeout: Option<Duration>)
13    where
14        F: Fn(&TachoMotor, &TachoMotor) -> bool + Send + Sync,
15    {
16    }
17
18    /// Waits until both motors are not moving anymore
19    pub fn wait_until_not_moving(&self, timeout: Option<Duration>) -> &Self {
20        self.left.wait_until_not_moving(timeout);
21        self.right.wait_until_not_moving(timeout);
22        self
23    }
24}