pub struct Focus { /* private fields */ }Expand description
Both roles live together so local activity and remote ownership agree.
Implementations§
Source§impl Focus
impl Focus
Sourcepub fn take(&mut self, take: Take, now: Instant) -> Vec<Action>
pub fn take(&mut self, take: Take, now: Instant) -> Vec<Action>
Start a direct take. A pending take ignores further takes; home always works.
pub fn on_accept(&mut self, peer: MachineId, accept: &Accept) -> Vec<Action>
pub fn on_refuse(&mut self, peer: MachineId, refuse: &Refuse) -> Vec<Action>
pub fn poll(&mut self, now: Instant) -> Vec<Action>
Sourcepub fn go_home(&mut self) -> Vec<Action>
pub fn go_home(&mut self) -> Vec<Action>
Return home and cancel both halves of a pending transition.
pub fn on_handover( &mut self, peer: MachineId, handover: &Handover, now: Instant, ) -> Vec<Action>
pub fn on_ack(&mut self, peer: MachineId, ack: &Ack) -> Vec<Action>
Sourcepub fn on_accepts(&mut self, peer: MachineId, accepts: bool) -> Vec<Action>
pub fn on_accepts(&mut self, peer: MachineId, accepts: bool) -> Vec<Action>
A policy denial cancels both an active drive and a pending take.
Sourcepub fn on_link_lost(&mut self, peer: MachineId) -> Vec<Action>
pub fn on_link_lost(&mut self, peer: MachineId) -> Vec<Action>
End ownership, pending takes and route history for this link. The daemon calls this whenever a link ends or is replaced by a newer link to the same peer.
Source§impl Focus
impl Focus
Sourcepub fn on_focus(
&mut self,
peer: MachineId,
focus: &WireFocus,
allow_drive: bool,
now: Instant,
) -> Vec<Action>
pub fn on_focus( &mut self, peer: MachineId, focus: &WireFocus, allow_drive: bool, now: Instant, ) -> Vec<Action>
Process a Focus from an authenticated peer. Policy is supplied per message.
Sourcepub fn on_remote_input(
&mut self,
peer: MachineId,
route: Route,
now: Instant,
) -> bool
pub fn on_remote_input( &mut self, peer: MachineId, route: Route, now: Instant, ) -> bool
Call for an accepted InputBatch or Motion, before injecting input.
Rejected routes never update the idle timer. This path does not allocate.
Sourcepub fn on_input_event(
&mut self,
peer: MachineId,
route: Route,
event: &InputEvent,
now: Instant,
) -> bool
pub fn on_input_event( &mut self, peer: MachineId, route: Route, event: &InputEvent, now: Instant, ) -> bool
Whether to inject a reliable event after route and held-input checks. Excess downs beyond the held-input cap are dropped before injection.
Sourcepub fn on_local_input(&mut self, now: Instant) -> (bool, Vec<Action>)
pub fn on_local_input(&mut self, now: Instant) -> (bool, Vec<Action>)
Whether to apply physical input, followed by effects of a local takeover. An active remote owner suppresses local input without refreshing local activity.
Sourcepub fn handover(&self, next: MachineId, landing: Option<Landing>) -> Vec<Action>
pub fn handover(&self, next: MachineId, landing: Option<Landing>) -> Vec<Action>
Request a reachable peer (or the owner’s home); ownership ends on let-go.
Sourcepub fn deny_drive(&mut self, peer: MachineId) -> Vec<Action>
pub fn deny_drive(&mut self, peer: MachineId) -> Vec<Action>
End this peer’s ownership immediately when local policy is revoked.
Source§impl Focus
impl Focus
pub fn new(own_id: MachineId) -> Self
Sourcepub fn set_locked(&mut self, locked: bool)
pub fn set_locked(&mut self, locked: bool)
Keep edge crossings on the current machine; explicit takes still work.
pub fn toggle_lock(&mut self)
pub fn is_locked(&self) -> bool
pub fn cursor(&self) -> Cursor
Sourcepub fn driving_route(&self) -> Option<Route>
pub fn driving_route(&self) -> Option<Route>
The active owner’s route, including the previous route during a take.
Sourcepub fn is_driven(&self) -> bool
pub fn is_driven(&self) -> bool
Whether physical input is currently suppressed by a remote owner.
Sourcepub fn next_deadline(&self) -> Option<Instant>
pub fn next_deadline(&self) -> Option<Instant>
None when there is no take awaiting an answer.