Skip to main content

InputNodeState

Struct InputNodeState 

Source
pub struct InputNodeState { /* private fields */ }
Expand description

Interactive text input state stored on NodeKind::Input.

Implementations§

Source§

impl InputNodeState

Text editing and fluent construction helpers for InputNodeState.

Source

pub fn text<S>(value: S) -> Self
where S: Into<String>,

Creates an enabled single-line InputNodeState initialized with value and caret at the end.

§Arguments
  • S - Initial input text value.
§Returns
  • Self - Ready InputNodeState.
Source

pub fn with_placeholder<S>(self, placeholder: S) -> Self
where S: Into<String>,

Sets placeholder text displayed when the input value is empty.

§Arguments
  • Self - Source input state.
  • S - Placeholder text.
§Returns
  • Self - Updated input state.
Source

pub fn with_password(self, password: bool) -> Self

Toggles masked password rendering.

§Arguments
  • Self - Source input state.
  • bool - Password mode flag.
§Returns
  • Self - Updated input state.
Source

pub fn with_multiline(self, multiline: bool) -> Self

Toggles multi-line text editing.

§Arguments
  • Self - Source input state.
  • bool - Multiline flag.
§Returns
  • Self - Updated input state.
Source

pub fn with_disabled(self, disabled: bool) -> Self

Toggles disabled state preventing user edits.

§Arguments
  • Self - Source input state.
  • bool - Disabled flag.
§Returns
  • Self - Updated input state.
Source

pub fn insert_str(&mut self, text: &str)

Inserts text at the current caret position and advances the caret.

§Arguments
  • &Self - Mutable input state.
  • &str - UTF-8 text to insert.
Source

pub fn backspace(&mut self)

Removes the character immediately preceding the caret if any.

§Arguments
  • &Self - Mutable input state.
Source§

impl InputNodeState

Source

pub fn get_value(&self) -> &String

Source

pub fn get_mut_value(&mut self) -> &mut String

Source

pub fn set_value(&mut self, val: String) -> &mut Self

Source

pub fn get_placeholder(&self) -> &String

Source

pub fn get_mut_placeholder(&mut self) -> &mut String

Source

pub fn set_placeholder(&mut self, val: String) -> &mut Self

Source

pub fn get_caret(&self) -> usize

Source

pub fn get_mut_caret(&mut self) -> &mut usize

Source

pub fn set_caret(&mut self, val: usize) -> &mut Self

Source

pub fn get_password(&self) -> bool

Source

pub fn get_mut_password(&mut self) -> &mut bool

Source

pub fn set_password(&mut self, val: bool) -> &mut Self

Source

pub fn get_multiline(&self) -> bool

Source

pub fn get_mut_multiline(&mut self) -> &mut bool

Source

pub fn set_multiline(&mut self, val: bool) -> &mut Self

Source

pub fn get_disabled(&self) -> bool

Source

pub fn get_mut_disabled(&mut self) -> &mut bool

Source

pub fn set_disabled(&mut self, val: bool) -> &mut Self

Source§

impl InputNodeState

Source

pub fn new( value: String, placeholder: String, caret: usize, password: bool, multiline: bool, disabled: bool, ) -> Self

Trait Implementations§

Source§

impl Clone for InputNodeState

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 InputNodeState

Source§

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

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

impl Default for InputNodeState

Source§

fn default() -> Self

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

impl Eq for InputNodeState

Source§

impl PartialEq for InputNodeState

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 InputNodeState

Auto Trait Implementations§

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> 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.