pub struct FocuserSynchronousProxy { /* private fields */ }
Implementations§
Source§impl FocuserSynchronousProxy
impl FocuserSynchronousProxy
pub fn new(channel: Channel) -> Self
pub fn into_channel(self) -> Channel
Sourcepub fn wait_for_event(
&self,
deadline: MonotonicInstant,
) -> Result<FocuserEvent, Error>
pub fn wait_for_event( &self, deadline: MonotonicInstant, ) -> Result<FocuserEvent, Error>
Waits until an event arrives and returns it. It is safe for other threads to make concurrent requests while waiting for an event.
Sourcepub fn request_focus(
&self,
view_ref: ViewRef,
___deadline: MonotonicInstant,
) -> Result<FocuserRequestFocusResult, Error>
pub fn request_focus( &self, view_ref: ViewRef, ___deadline: MonotonicInstant, ) -> Result<FocuserRequestFocusResult, Error>
Asks the server to transfer focus to the View specified by view_ref
,
with the authority of the requestor ViewRef. Such a request may be
honored or denied.
If the request was honored, and it triggers a focus change, a FocusEvent (with focused=true) is issued to the newly-focused View, and a FocusEvent (with focused=false) is issued to the previous View.
The result callback indicates that the request was received and honored. It does not guarantee that the requested View actually received a FocusEvent in time.
The request may be denied for many reasons, for example:
- if
view_ref
is invalid - if there is no View backed by
view_ref
- if there is no requestor ViewRef accessible to Focuser
- if the requestor ViewRef lacks authority over
view_ref
’s View - if
view_ref
’s View is not hittable or may not receive focus etc. A denied request is indicated with a Error.
Sourcepub fn set_auto_focus(
&self,
payload: FocuserSetAutoFocusRequest,
___deadline: MonotonicInstant,
) -> Result<FocuserSetAutoFocusResult, Error>
pub fn set_auto_focus( &self, payload: FocuserSetAutoFocusRequest, ___deadline: MonotonicInstant, ) -> Result<FocuserSetAutoFocusResult, Error>
Sets the auto focus target to the View specified by view_ref
.
To unset the target, pass in an empty table.
If a target has been set, then whenever the caller’s View would receive focus, an attempt is made to transfer focus immediately to the target instead. If the target is unfocusable, the new target is the first focusable ancestor of the target instead. Setting an auto focus target places no limitations on simultaneous use of RequestFocus().
An auto focus target is “valid” only while it is a descendant of the caller’s View in the ViewTree. Specifying an invalid auto focus target is allowed, since it may become valid later. It is the client’s responsibility to ensure the target is a valid receiver of auto focus.
If the target is invalid when the auto focus behavior would trigger, then the attempt to move focus will silently fail and focus will remain with the caller’s View. A target may become invalid and then become valid again any number of times; auto focus will continue to function whenever the target is in a valid state, and will continue to ignore the target while it’s in an invalid state.
If the focus would by some further automatic mechanism return to the caller’s View (e.g. if the target is unfocusable), then focus will remain with the caller’s View.
AutoFocusError is currently never returned, and is reserved for possible future use.
Trait Implementations§
Source§impl Debug for FocuserSynchronousProxy
impl Debug for FocuserSynchronousProxy
Source§impl SynchronousProxy for FocuserSynchronousProxy
impl SynchronousProxy for FocuserSynchronousProxy
Source§type Proxy = FocuserProxy
type Proxy = FocuserProxy
Source§type Protocol = FocuserMarker
type Protocol = FocuserMarker
Proxy
controls.