Skip to main content

Input

Struct Input 

Source
pub struct Input<R: Renderer> { /* private fields */ }

Implementations§

Source§

impl<R: Renderer> Input<R>

Source

pub fn new() -> Self

Source

pub fn is_empty(&self) -> bool

Source

pub fn value(&self) -> String

Source

pub fn placeholder(&self) -> &str

Source

pub fn overwrite(&mut self, value: &str)

Source

pub fn layout( &mut self, renderer: &R, limits: &Limits, layout: Layout<'_, R::Font>, ) -> Node

Source

pub fn update<Message>( &mut self, event: &Event, bounds: Rectangle, cursor: Cursor, shell: &mut Shell<'_, Message>, key_binding: impl Fn(KeyPress) -> Option<Binding<Message>>, ) -> Option<Edit>

Source

pub fn draw( &self, renderer: &mut R, bounds: Rectangle, viewport: Rectangle, style: Style, )

Source

pub fn input_method(&self, position: Point) -> InputMethod<&str>

Trait Implementations§

Source§

impl<R: Renderer> Default for Input<R>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<R: Renderer> Focusable for Input<R>

Source§

fn is_focused(&self) -> bool

Returns whether the widget is focused or not.
Source§

fn focus(&mut self)

Focuses the widget.
Source§

fn unfocus(&mut self)

Unfocuses the widget.
Source§

impl<R: Renderer> TextInput for Input<R>

Source§

fn text(&self) -> Fragment<'_>

Returns the current visible text of the text input. Read more
Source§

fn move_cursor_to(&mut self, position: Position)

Moves the cursor of the text input to an arbitrary location.
Source§

fn move_cursor_to_front(&mut self)

Moves the cursor of the text input to the front of the input text.
Source§

fn move_cursor_to_end(&mut self)

Moves the cursor of the text input to the end of the input text.
Source§

fn select_all(&mut self)

Selects all the content of the text input.
Source§

fn select_range(&mut self, start: Position, end: Position)

Selects the given content range of the text input.

Auto Trait Implementations§

§

impl<R> Freeze for Input<R>
where <R as Renderer>::Editor: Freeze, <R as Renderer>::Paragraph: Freeze,

§

impl<R> RefUnwindSafe for Input<R>

§

impl<R> Send for Input<R>
where <R as Renderer>::Editor: Send, <R as Renderer>::Paragraph: Send,

§

impl<R> Sync for Input<R>
where <R as Renderer>::Editor: Sync, <R as Renderer>::Paragraph: Sync,

§

impl<R> Unpin for Input<R>
where <R as Renderer>::Editor: Unpin, <R as Renderer>::Paragraph: Unpin,

§

impl<R> UnsafeUnpin for Input<R>

§

impl<R> UnwindSafe for Input<R>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.