diff options
author | 2022-08-05 05:15:41 +0200 | |
---|---|---|
committer | 2022-08-05 05:15:41 +0200 | |
commit | 66f7d43dc98df96c8b19cfd2aef6dcdd4187316c (patch) | |
tree | a252a9c81359d2f13401380538bd11c0ee6bbc37 /native/src/widget/text_input.rs | |
parent | 13dd1ca0a83cc95eea52e2106da9dc1ee1f37958 (diff) | |
download | iced-66f7d43dc98df96c8b19cfd2aef6dcdd4187316c.tar.gz iced-66f7d43dc98df96c8b19cfd2aef6dcdd4187316c.tar.bz2 iced-66f7d43dc98df96c8b19cfd2aef6dcdd4187316c.zip |
Write missing documentation in `iced_native`
Diffstat (limited to 'native/src/widget/text_input.rs')
-rw-r--r-- | native/src/widget/text_input.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/native/src/widget/text_input.rs b/native/src/widget/text_input.rs index e0216a5b..8ddbc734 100644 --- a/native/src/widget/text_input.rs +++ b/native/src/widget/text_input.rs @@ -314,19 +314,25 @@ where } } +/// The identifier of a [`TextInput`]. #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct Id(widget::Id); impl Id { + /// Creates a custom [`Id`]. pub fn new(id: impl Into<std::borrow::Cow<'static, str>>) -> Self { Self(widget::Id::new(id)) } + /// Creates a unique [`Id`]. + /// + /// This function produces a different [`Id`] every time it is called. pub fn unique() -> Self { Self(widget::Id::unique()) } } +/// Produces a [`Command`] that focuses the [`TextInput`] with the given [`Id`]. pub fn focus<Message: 'static>(id: Id) -> Command<Message> { Command::widget(operation::focusable::focus(id.0)) } |