pub enum BeaconState {
Uninitialized,
Running {
last_beacon_time: Instant,
last_course: Option<f64>,
last_speed: Option<f64>,
},
}Expand description
SmartBeaconing runtime state.
The algorithm starts in BeaconState::Uninitialized and transitions
to BeaconState::Running the first time a beacon is recorded via
SmartBeaconing::beacon_sent_with. The state holds the last
beacon’s course and speed so subsequent turn-threshold checks have
the reference data they need.
Variants§
Uninitialized
No beacon has been sent yet — first call to should_beacon /
beacon_reason will return Some(BeaconReason::First).
Running
At least one beacon has been sent. Carries the timestamp and the (course, speed) recorded at that beacon.
Trait Implementations§
Source§impl Clone for BeaconState
impl Clone for BeaconState
Source§fn clone(&self) -> BeaconState
fn clone(&self) -> BeaconState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BeaconState
impl Debug for BeaconState
Source§impl PartialEq for BeaconState
impl PartialEq for BeaconState
impl StructuralPartialEq for BeaconState
Auto Trait Implementations§
impl Freeze for BeaconState
impl RefUnwindSafe for BeaconState
impl Send for BeaconState
impl Sync for BeaconState
impl Unpin for BeaconState
impl UnwindSafe for BeaconState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more