pub struct CuSessionTracker { /* private fields */ }Expand description
Protocol-independent session rules shared by every bridge.
The bridge feeds it requests from Copper and events decoded from the controller. It owns no I/O and never allocates.
Implementations§
Source§impl CuSessionTracker
impl CuSessionTracker
Sourcepub fn state(&self) -> &CuSessionState
pub fn state(&self) -> &CuSessionState
Current state.
Sourcepub fn take_changed(&mut self) -> bool
pub fn take_changed(&mut self) -> bool
True once since the last call if the state changed.
Sourcepub fn request(&mut self, command: CuSessionCommand) -> CuSessionDecision
pub fn request(&mut self, command: CuSessionCommand) -> CuSessionDecision
Handle one request from Copper.
Sourcepub fn take_outgoing(&mut self) -> Option<CuSessionCommand>
pub fn take_outgoing(&mut self) -> Option<CuSessionCommand>
The queued command, removed from the queue. Pass it to
mark_sent once written.
Sourcepub fn mark_sent(&mut self, command: CuSessionCommand, sequence: u32)
pub fn mark_sent(&mut self, command: CuSessionCommand, sequence: u32)
Record that command went out with protocol sequence sequence.
Sourcepub fn on_acknowledged(&mut self, sequence: u32)
pub fn on_acknowledged(&mut self, sequence: u32)
The controller accepted command sequence. Other sequences are ignored.
Sourcepub fn on_rejected(&mut self, sequence: u32, detail: &str)
pub fn on_rejected(&mut self, sequence: u32, detail: &str)
The controller refused command sequence with detail.
Sourcepub fn on_control_report(&mut self, in_control: bool)
pub fn on_control_report(&mut self, in_control: bool)
The controller reported whether this client is in control. On controllers that answer control requests this way instead of with an acknowledgement, it also completes a pending acquire or release.
Sourcepub fn on_drive_report(&mut self, drives_ready: bool, motion_allowed: bool)
pub fn on_drive_report(&mut self, drives_ready: bool, motion_allowed: bool)
The controller reported drive readiness and whether it would accept motion.
Sourcepub fn on_disconnected(&mut self)
pub fn on_disconnected(&mut self)
The transport was lost: nothing is pending and nothing is held.
Sourcepub fn shutdown_step(&self) -> Option<CuSessionCommand>
pub fn shutdown_step(&self) -> Option<CuSessionCommand>
Next command to wind the session down, or None once this session
holds nothing: disable drives this session enabled, then release
control this session acquired. Queue it with request
when the tracker is not busy.
Trait Implementations§
Source§impl Clone for CuSessionTracker
impl Clone for CuSessionTracker
Source§fn clone(&self) -> CuSessionTracker
fn clone(&self) -> CuSessionTracker
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CuSessionTracker
impl Debug for CuSessionTracker
Source§impl Default for CuSessionTracker
impl Default for CuSessionTracker
Source§fn default() -> CuSessionTracker
fn default() -> CuSessionTracker
Auto Trait Implementations§
impl Freeze for CuSessionTracker
impl RefUnwindSafe for CuSessionTracker
impl Send for CuSessionTracker
impl Sync for CuSessionTracker
impl Unpin for CuSessionTracker
impl UnsafeUnpin for CuSessionTracker
impl UnwindSafe for CuSessionTracker
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> GetTypeRegistration for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more