pub struct FocusListener { /* private fields */ }Expand description
FocusListener listens to focus change and notify to related input modules.
Implementations§
Source§impl FocusListener
impl FocusListener
Sourcepub fn new(
focus_chain_publisher: FocusChainProviderPublisher,
metrics_logger: MetricsLogger,
) -> Result<Self, Error>
pub fn new( focus_chain_publisher: FocusChainProviderPublisher, metrics_logger: MetricsLogger, ) -> Result<Self, Error>
Creates a new focus listener that holds proxy to text manager. The caller is expected to spawn a task to continually listen to focus change event.
§Arguments
focus_chain_publisher: Allows focus chain updates to be sent to downstream listeners. Note that this is not required forFocusListenerto function, so it could be made anOptionin future changes.
§Example
ⓘ
let mut listener = FocusListener::new(focus_chain_publisher);
let task = fuchsia_async::Task::local(async move {
listener.dispatch_focus_changes().await
});§FIDL
Required:
fuchsia.ui.views.FocusChainListenerfuchsia.ui.keyboard.focus.Controller
§Errors
If unable to connect to the text_manager protocol.
Sourcepub async fn dispatch_focus_changes(&mut self) -> Result<(), Error>
pub async fn dispatch_focus_changes(&mut self) -> Result<(), Error>
Dispatches focus chain updates from focus_chain_listener to text_manager and any subscribers of focus_chain_publisher.
Auto Trait Implementations§
impl Freeze for FocusListener
impl !RefUnwindSafe for FocusListener
impl Send for FocusListener
impl Sync for FocusListener
impl Unpin for FocusListener
impl UnsafeUnpin for FocusListener
impl !UnwindSafe for FocusListener
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
Mutably borrows from an owned value. Read more
Source§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
Source§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
§impl<T> InstanceFromServiceTransport<T> for T
impl<T> InstanceFromServiceTransport<T> for T
§fn from_service_transport(handle: T) -> T
fn from_service_transport(handle: T) -> T
Converts the given service transport handle of type
T to [Self]§impl<T> IntoAny for T
impl<T> IntoAny 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>
Converts
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>
Converts
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