Skip to main content

InputConfig

Struct InputConfig 

Source
pub struct InputConfig {
Show 28 fields pub style: ResolvedTextStyle, pub align: TextAlign, pub placeholder: String, pub placeholder_color: Option<Color>, pub secure: bool, pub keyboard: KeyboardType, pub keyboard_appearance: KeyboardAppearance, pub return_key: ReturnKeyType, pub auto_capitalize: AutoCapitalize, pub auto_correct: bool, pub multiline: bool, pub max_length: Option<u32>, pub editable: bool, pub blur_on_submit: bool, pub submit_behavior: Option<SubmitBehavior>, pub paste_behavior: PasteBehavior, pub paste_max_size: Option<u64>, pub auto_focus: bool, pub select_text_on_focus: bool, pub selection_color: Option<Color>, pub caret_color: Option<Color>, pub auto_fill: AutoFill, pub rtl: bool, pub caret_hidden: bool, pub accessory_id: Option<Box<str>>, pub accessory: Option<NodeId>, pub scrollbar_visible: bool, pub report_scroll: bool,
}
Expand description

Everything about a text input except its text.

Fields§

§style: ResolvedTextStyle

Font and color of the text.

§align: TextAlign

Alignment of the text.

§placeholder: String

Shown while the text is empty.

§placeholder_color: Option<Color>

Placeholder color; the platform’s default when None.

§secure: bool

Hide the characters (passwords).

§keyboard: KeyboardType

Keyboard layout.

§keyboard_appearance: KeyboardAppearance

The keyboard’s look (iOS).

§return_key: ReturnKeyType

Label of the return key.

§auto_capitalize: AutoCapitalize

Automatic capitalization.

§auto_correct: bool

The system’s corrections: spelling, smart quotes and dashes, text replacement.

§multiline: bool

Several lines (return inserts a line break).

§max_length: Option<u32>

The most characters the user’s edits leave (maxLength), counted as Unicode scalar values (crate::text_edit::char_len); an insertion is cut by crate::text_edit::clip_chars.

§editable: bool

The user can edit the text.

§blur_on_submit: bool

Return unfocuses a single-line input without a submitBehavior (always true from TS); InputConfig::submit resolves it.

§submit_behavior: Option<SubmitBehavior>

submitBehavior as set; InputConfig::submit resolves it.

§paste_behavior: PasteBehavior

What a paste does (pasteBehavior).

§paste_max_size: Option<u64>

The largest pasted file read, in bytes (pasteMaxSize): a larger one goes to crate::PasteEvent::too_large unread. None: all.

§auto_focus: bool

Focus once on screen.

§select_text_on_focus: bool

Select the whole text when the input takes the focus (selectTextOnFocus).

§selection_color: Option<Color>

Selection highlight color (on iOS also the caret’s, unless InputConfig::caret_color is set: UIKit tints both with one).

§caret_color: Option<Color>

Caret color; the platform’s default when None.

§auto_fill: AutoFill

What the input holds, for autofill.

§rtl: bool

The text runs right to left.

§caret_hidden: bool

No caret is drawn (caret={false}).

§accessory_id: Option<Box<str>>

inputAccessoryViewID as set.

§accessory: Option<NodeId>

The input accessory it names, if one is mounted.

§scrollbar_visible: bool

A multiline input shows its scroll indicator (scrollbar; false while a built-in bar takes its place).

§report_scroll: bool

A bar of the app’s follows a multiline input’s text (its built-in bar, or one the app placed that watches it, watch_scroll): the platform reports how far the text scrolled (EngineControl::input_scroll). Off, it reports nothing.

Implementations§

Source§

impl InputConfig

Source

pub fn submit(&self) -> SubmitBehavior

What return does, as submitBehavior and multiline say together: the set behavior (a single line never takes line breaks), else a line break in a multiline input, else a submit that unfocuses unless InputConfig::blur_on_submit is false (Rust).

Source

pub fn visible_password(&self) -> bool

A password shown as plain text: the input holds a password (InputConfig::auto_fill current-password or new-password) but is not secure, as after a “show password” toggle. Platforms type it as it is: Android’s visible password keyboard, iOS’s ASCII keyboard, never capitalized, suggested or corrected.

Trait Implementations§

Source§

impl Clone for InputConfig

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for InputConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for InputConfig

Source§

fn default() -> Self

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

impl PartialEq for InputConfig

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for InputConfig

Auto Trait Implementations§

§

impl Forget for InputConfig

§

impl Freeze for InputConfig

§

impl Move for InputConfig

§

impl RefUnwindSafe for InputConfig

§

impl Send for InputConfig
where RawVecInner: Send, BoxRaw<str>: Send,

§

impl Sync for InputConfig
where RawVecInner: Sync, BoxRaw<str>: Sync,

§

impl Unpin for InputConfig
where *const u8 is !null: Unpin, Box<str>: Unpin,

§

impl UnsafeUnpin for InputConfig

§

impl UnwindSafe for InputConfig
where RawVecInner: UnwindSafe, BoxRaw<str>: UnwindSafe,

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.