pub struct Input {
pub min_rows: usize,
/* private fields */
}Fields§
§min_rows: usizeImplementations§
Source§impl Input
impl Input
pub fn new(value: impl Into<SharedString>, cx: &mut Context<'_, Self>) -> Self
pub fn placeholder(self, p: impl Into<SharedString>) -> Self
pub fn disabled(self, d: bool) -> Self
pub fn clearable(self, c: bool) -> Self
pub fn icon_prefix(self, icon: IconName) -> Self
pub fn icon_suffix(self, icon: IconName) -> Self
pub fn set_icon_suffix( &mut self, icon: Option<IconName>, cx: &mut Context<'_, Self>, )
pub fn set_clearable(&mut self, clearable: bool, cx: &mut Context<'_, Self>)
pub fn filter(self, f: impl Fn(&str) -> bool + 'static) -> Self
pub fn max_length(self, max: usize) -> Self
pub fn password(self) -> Self
pub fn mask_char(self, c: char) -> Self
pub fn min_rows(self, rows: usize) -> Self
pub fn height(self, h: impl Into<Pixels>) -> Self
pub fn width(self, w: impl Into<Pixels>) -> Self
pub fn width_sm(self) -> Self
pub fn set_width(&mut self, w: impl Into<Pixels>, cx: &mut Context<'_, Self>)
pub fn set_width_sm(&mut self, cx: &mut Context<'_, Self>)
pub fn text_align(self, align: TextAlign) -> Self
pub fn on_enter( self, f: impl Fn(&mut Self, &str, &mut Window, &mut Context<'_, Self>) + 'static, ) -> Self
pub fn set_on_enter( &mut self, f: impl Fn(&mut Self, &str, &mut Window, &mut Context<'_, Self>) + 'static, cx: &mut Context<'_, Self>, )
pub fn on_change( self, f: impl Fn(&str, &mut Context<'_, Self>) + 'static, ) -> Self
pub fn set_on_change( &mut self, f: impl Fn(&str, &mut Context<'_, Self>) + 'static, )
pub fn clear_on_change(&mut self)
pub fn set_placeholder( &mut self, p: impl Into<SharedString>, cx: &mut Context<'_, Self>, )
pub fn set_disabled(&mut self, d: bool, cx: &mut Context<'_, Self>)
pub fn set_value( &mut self, value: impl Into<SharedString>, cx: &mut Context<'_, Self>, )
pub fn set_min_rows(&mut self, rows: usize, cx: &mut Context<'_, Self>)
pub fn value(&self) -> SharedString
pub fn selected_range(&self) -> Range<usize>
pub fn insert_text(&mut self, text: &str, cx: &mut Context<'_, Self>)
pub fn indent_selection(&mut self, indent: &str, cx: &mut Context<'_, Self>)
pub fn outdent_selection(&mut self, indent: &str, cx: &mut Context<'_, Self>)
pub fn register_key_bindings(cx: &mut App)
pub fn clear(&mut self, cx: &mut Context<'_, Self>)
pub fn prepend( self, render: impl Fn(&mut Window, &mut App) -> AnyElement + 'static, ) -> Self
pub fn prepend_text(self, text: impl Into<SharedString>) -> Self
pub fn prepend_icon(self, icon: IconName) -> Self
pub fn append( self, render: impl Fn(&mut Window, &mut App) -> AnyElement + 'static, ) -> Self
pub fn append_text(self, text: impl Into<SharedString>) -> Self
Trait Implementations§
Source§impl EntityInputHandler for Input
impl EntityInputHandler for Input
Source§fn text_for_range(
&mut self,
range_utf16: Range<usize>,
_: &mut Option<Range<usize>>,
_: &mut Window,
_: &mut Context<'_, Self>,
) -> Option<String>
fn text_for_range( &mut self, range_utf16: Range<usize>, _: &mut Option<Range<usize>>, _: &mut Window, _: &mut Context<'_, Self>, ) -> Option<String>
See
InputHandler::text_for_range for detailsSource§fn selected_text_range(
&mut self,
_: bool,
_: &mut Window,
_: &mut Context<'_, Self>,
) -> Option<UTF16Selection>
fn selected_text_range( &mut self, _: bool, _: &mut Window, _: &mut Context<'_, Self>, ) -> Option<UTF16Selection>
See
InputHandler::selected_text_range for detailsSource§fn marked_text_range(
&self,
_: &mut Window,
_: &mut Context<'_, Self>,
) -> Option<Range<usize>>
fn marked_text_range( &self, _: &mut Window, _: &mut Context<'_, Self>, ) -> Option<Range<usize>>
See
InputHandler::marked_text_range for detailsSource§fn unmark_text(&mut self, _: &mut Window, _: &mut Context<'_, Self>)
fn unmark_text(&mut self, _: &mut Window, _: &mut Context<'_, Self>)
See
InputHandler::unmark_text for detailsSource§fn replace_text_in_range(
&mut self,
range_utf16: Option<Range<usize>>,
new_text: &str,
_: &mut Window,
cx: &mut Context<'_, Self>,
)
fn replace_text_in_range( &mut self, range_utf16: Option<Range<usize>>, new_text: &str, _: &mut Window, cx: &mut Context<'_, Self>, )
See
InputHandler::replace_text_in_range for detailsSource§fn replace_and_mark_text_in_range(
&mut self,
range_utf16: Option<Range<usize>>,
new_text: &str,
new_selected: Option<Range<usize>>,
_: &mut Window,
cx: &mut Context<'_, Self>,
)
fn replace_and_mark_text_in_range( &mut self, range_utf16: Option<Range<usize>>, new_text: &str, new_selected: Option<Range<usize>>, _: &mut Window, cx: &mut Context<'_, Self>, )
See
InputHandler::replace_and_mark_text_in_range for detailsSource§fn bounds_for_range(
&mut self,
range_utf16: Range<usize>,
bounds: Bounds<Pixels>,
window: &mut Window,
_: &mut Context<'_, Self>,
) -> Option<Bounds<Pixels>>
fn bounds_for_range( &mut self, range_utf16: Range<usize>, bounds: Bounds<Pixels>, window: &mut Window, _: &mut Context<'_, Self>, ) -> Option<Bounds<Pixels>>
See
InputHandler::bounds_for_range for detailsSource§fn character_index_for_point(
&mut self,
pt: Point<Pixels>,
window: &mut Window,
_: &mut Context<'_, Self>,
) -> Option<usize>
fn character_index_for_point( &mut self, pt: Point<Pixels>, window: &mut Window, _: &mut Context<'_, Self>, ) -> Option<usize>
See
InputHandler::character_index_for_point for detailsSource§impl Focusable for Input
impl Focusable for Input
Source§fn focus_handle(&self, _cx: &App) -> FocusHandle
fn focus_handle(&self, _cx: &App) -> FocusHandle
Returns the focus handle associated with this view.
Auto Trait Implementations§
impl !RefUnwindSafe for Input
impl !Send for Input
impl !Sync for Input
impl !UnwindSafe for Input
impl Freeze for Input
impl Unpin for Input
impl UnsafeUnpin for Input
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
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