pub struct TextFieldHandle { /* private fields */ }Expand description
A live handle on a TextInputField — its text-editing commands, for a
caller outside the widget.
Every method is a no-op before the field is built (and after it is destroyed), which is the honest answer rather than a panic: a menu row bound to a field that is no longer on screen should do nothing, not crash.
Implementations§
Source§impl TextFieldHandle
impl TextFieldHandle
Sourcepub fn detached() -> Self
pub fn detached() -> Self
A handle not yet attached to any field — for a composing widget that
hands one out before building the field it will delegate to. Every
method answers “nothing” until TextInputField::share_handle binds it.
Sourcepub fn focused_signal(&self) -> Signal<bool>
pub fn focused_signal(&self) -> Signal<bool>
true while this field holds the keyboard focus. Observable, so a
router can follow the caret without polling.
Sourcepub fn has_selection(&self) -> bool
pub fn has_selection(&self) -> bool
Is any text selected right now?
Sourcepub fn allows_copy(&self) -> bool
pub fn allows_copy(&self) -> bool
May this field’s content be copied at all? A password field says no —
see TextInputField::allow_copy.
Sourcepub fn is_read_only(&self) -> bool
pub fn is_read_only(&self) -> bool
Is the field refusing edits? Cut and Paste are meaningless when it is.
Sourcepub fn select_all(&self)
pub fn select_all(&self)
Select the whole field.
Trait Implementations§
Source§impl Clone for TextFieldHandle
impl Clone for TextFieldHandle
Source§fn clone(&self) -> TextFieldHandle
fn clone(&self) -> TextFieldHandle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TextFieldHandle
impl Debug for TextFieldHandle
Source§impl TextSurface for TextFieldHandle
impl TextSurface for TextFieldHandle
Source§fn paste_plain(&self, ctx: &EventContext<'_>)
fn paste_plain(&self, ctx: &EventContext<'_>)
A one-line field carries no formatting to strip, so the plain paste is the paste. Answering “nothing” here would make Edit ▸ Paste without formatting silently dead over a rename box.
Source§fn can_undo(&self) -> bool
fn can_undo(&self) -> bool
fn undo(&self)
fn redo(&self)
Source§fn has_selection(&self) -> bool
fn has_selection(&self) -> bool
Source§fn is_read_only(&self) -> bool
fn is_read_only(&self) -> bool
Source§fn allows_copy(&self) -> bool
fn allows_copy(&self) -> bool
fn cut(&self, ctx: &EventContext<'_>)
fn copy(&self, ctx: &EventContext<'_>)
fn paste(&self, ctx: &EventContext<'_>)
fn select_all(&self)
§fn history_frozen(&self) -> bool
fn history_frozen(&self) -> bool
Auto Trait Implementations§
impl !RefUnwindSafe for TextFieldHandle
impl !Send for TextFieldHandle
impl !Sync for TextFieldHandle
impl !UnwindSafe for TextFieldHandle
impl Freeze for TextFieldHandle
impl Unpin for TextFieldHandle
impl UnsafeUnpin for TextFieldHandle
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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