pub struct ViewRefFocusedProxy { /* private fields */ }
Implementations§
Source§impl ViewRefFocusedProxy
impl ViewRefFocusedProxy
Sourcepub fn new(channel: AsyncChannel) -> Self
pub fn new(channel: AsyncChannel) -> Self
Create a new Proxy for fuchsia.ui.views/ViewRefFocused.
Sourcepub fn take_event_stream(&self) -> ViewRefFocusedEventStream
pub fn take_event_stream(&self) -> ViewRefFocusedEventStream
Get a Stream of events from the remote end of the protocol.
§Panics
Panics if the event stream was already taken.
Sourcepub fn watch(
&self,
) -> QueryResponseFut<FocusState, DefaultFuchsiaResourceDialect>
pub fn watch( &self, ) -> QueryResponseFut<FocusState, DefaultFuchsiaResourceDialect>
Sets up a callback to fire when the implicit ViewRef has gained or lost focus. Typically, focus changes happen at a slow pace, such that every transition is captured by the callback. However, focus changes can happen rapidly, so the callback may “compress” focus change history into just the latest known focus state.
The callback reports the last focus change spanning the duration from its issuance to the previous callback’s issuance. The client may observe any of the following four transitions:
- true -> true: The ViewRef has lost focus at least once, and has gained focus by the time of callback issuance.
- true -> false: The ViewRef has lost focus at least once, and has lost focus by the time of callback issuance.
- false -> true: The ViewRef has gained focus at least once, and has gained focus by the time of callback issuance.
- false -> false: The ViewRef has gained focus at least once, and has lost focus by the time of callback issuance.
The client avoids “focus flapping” and always sees the latest state. Every callback issuance is meaningful, and the client should renegotiate focus-related services appropriately, such as IME.
Flow control: The caller is allowed at most one in-flight |Watch| call at at time: subsequent |Watch| calls must wait until the acknowledgment returns. Non-compliance results in channel closure.
Trait Implementations§
Source§impl Clone for ViewRefFocusedProxy
impl Clone for ViewRefFocusedProxy
Source§fn clone(&self) -> ViewRefFocusedProxy
fn clone(&self) -> ViewRefFocusedProxy
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ViewRefFocusedProxy
impl Debug for ViewRefFocusedProxy
Source§impl Proxy for ViewRefFocusedProxy
impl Proxy for ViewRefFocusedProxy
Source§type Protocol = ViewRefFocusedMarker
type Protocol = ViewRefFocusedMarker
Proxy
controls.Source§fn from_channel(inner: AsyncChannel) -> Self
fn from_channel(inner: AsyncChannel) -> Self
Source§fn into_channel(self) -> Result<AsyncChannel, Self>
fn into_channel(self) -> Result<AsyncChannel, Self>
Source§fn as_channel(&self) -> &AsyncChannel
fn as_channel(&self) -> &AsyncChannel
§fn into_client_end(self) -> Result<ClientEnd<Self::Protocol>, Self>
fn into_client_end(self) -> Result<ClientEnd<Self::Protocol>, Self>
Source§impl ViewRefFocusedProxyInterface for ViewRefFocusedProxy
impl ViewRefFocusedProxyInterface for ViewRefFocusedProxy
type WatchResponseFut = QueryResponseFut<FocusState>
fn watch(&self) -> Self::WatchResponseFut
Auto Trait Implementations§
impl Freeze for ViewRefFocusedProxy
impl !RefUnwindSafe for ViewRefFocusedProxy
impl Send for ViewRefFocusedProxy
impl Sync for ViewRefFocusedProxy
impl Unpin for ViewRefFocusedProxy
impl !UnwindSafe for ViewRefFocusedProxy
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,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)