Skip to main content

Focus

Struct Focus 

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

Both roles live together so local activity and remote ownership agree.

Implementations§

Source§

impl Focus

Source

pub fn take(&mut self, take: Take, now: Instant) -> Vec<Action>

Start a direct take. A pending take ignores further takes; home always works.

Source

pub fn on_accept(&mut self, peer: MachineId, accept: &Accept) -> Vec<Action>

Source

pub fn on_refuse(&mut self, peer: MachineId, refuse: &Refuse) -> Vec<Action>

Source

pub fn poll(&mut self, now: Instant) -> Vec<Action>

Source

pub fn go_home(&mut self) -> Vec<Action>

Return home and cancel both halves of a pending transition.

Source

pub fn on_handover( &mut self, peer: MachineId, handover: &Handover, now: Instant, ) -> Vec<Action>

Source

pub fn on_ack(&mut self, peer: MachineId, ack: &Ack) -> Vec<Action>

Source

pub fn on_accepts(&mut self, peer: MachineId, accepts: bool) -> Vec<Action>

A policy denial cancels both an active drive and a pending take.

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

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn deny_drive(&mut self, peer: MachineId) -> Vec<Action>

End this peer’s ownership immediately when local policy is revoked.

Source§

impl Focus

Source

pub fn new(own_id: MachineId) -> Self

Source

pub fn set_locked(&mut self, locked: bool)

Keep edge crossings on the current machine; explicit takes still work.

Source

pub fn toggle_lock(&mut self)

Source

pub fn is_locked(&self) -> bool

Source

pub fn cursor(&self) -> Cursor

Source

pub fn driving_route(&self) -> Option<Route>

The active owner’s route, including the previous route during a take.

Source

pub fn is_driven(&self) -> bool

Whether physical input is currently suppressed by a remote owner.

Source

pub fn driven_by(&self) -> Option<MachineId>

The peer currently driving this machine.

Source

pub fn next_deadline(&self) -> Option<Instant>

None when there is no take awaiting an answer.

Trait Implementations§

Source§

impl Debug for Focus

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Forget for Focus

§

impl Freeze for Focus

§

impl Move for Focus

§

impl RefUnwindSafe for Focus

§

impl Send for Focus

§

impl Sync for Focus

§

impl Unpin for Focus

§

impl UnsafeUnpin for Focus

§

impl UnwindSafe for Focus

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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.