Skip to main content

InputBaseState

Struct InputBaseState 

Source
pub struct InputBaseState<M: InputModeKind> { /* private fields */ }
Expand description

The shared text-editing engine behind crate::input::InputState, crate::input::TextareaState and crate::input::EditorState.

M is the mode marker: it carries no data and only decides which methods exist, so an ordinary input cannot reach the editor’s language features.

The three states are type aliases of this one, which is why this name is public: an alias is only as usable as the type behind it, so hiding this would leave InputState unable to do anything. Prefer naming the aliases — write InputState, not InputBaseState<InputMode>.

Implementations§

Source§

impl InputBaseState<EditorMode>

Source

pub fn create_decorations_collection( &mut self, decorations: Vec<TextDecoration>, cx: &mut Context<'_, Self>, ) -> TextDecorationCollection

Create an independently managed collection of text decorations.

This follows Monaco’s createDecorationsCollection ownership model. Ranges use UTF-8 byte offsets into Self::value.

Decoration ranges follow text edits and do not need to be set again after each change. Insertions at a range boundary do not expand the range, matching Monaco’s NeverGrowsWhenTypingAtEdges behavior. Decorations are not rendered while the input is masked. Collections live until their InputBaseState is dropped.

Collections are layered in insertion order; the first collection wins when overlapping decorations set the same HighlightStyle property. Callers should avoid conflicting overlaps within one collection.

Source§

impl InputBaseState<EditorMode>

Source

pub fn lsp(&self) -> &Lsp

The LSP providers and their cached results.

This exists on the editor alone: an ordinary input or textarea has no language server, and no field to reach one through.

Source

pub fn lsp_mut(&mut self) -> &mut Lsp

The LSP providers, mutably. Configure the providers through this.

Source§

impl InputBaseState<EditorMode>

Indent guides are a code-editor affordance.

Source

pub fn set_indent_guides( &mut self, indent_guides: bool, _: &mut Window, cx: &mut Context<'_, Self>, )

Set indent guides at runtime.

Source§

impl<M: MultiLineMode> InputBaseState<M>

Tab size only means something where there is more than one line to indent.

Source

pub fn set_tab_size(&mut self, tab: TabSize, cx: &mut Context<'_, Self>)

Source§

impl InputBaseState<EditorMode>

Source

pub fn perform_code_action( &mut self, item: &CodeActionItem, window: &mut Window, cx: &mut Context<'_, Self>, )

Source§

impl InputBaseState<EditorMode>

Source

pub fn clear_hover_state(&mut self, cx: &mut Context<'_, Self>)

Source§

impl InputBaseState<EditorMode>

Source

pub fn present_completion_items( &mut self, trigger_start_offset: usize, query: impl Into<String>, items: Vec<CompletionItem>, cx: &mut Context<'_, Self>, )

Source

pub fn present_code_actions( &mut self, items: Vec<CodeActionItem>, cx: &mut Context<'_, Self>, )

Source

pub fn present_hover( &mut self, symbol_range: Range<usize>, hover: Hover, cx: &mut Context<'_, Self>, )

Source

pub fn present_diagnostic( &mut self, diagnostic: DiagnosticEntry, cx: &mut Context<'_, Self>, )

Source

pub fn clear_diagnostic_popover(&mut self, cx: &mut Context<'_, Self>)

Source

pub fn route_overlay_action( &mut self, action: Box<dyn Action>, window: &mut Window, cx: &mut Context<'_, Self>, ) -> bool

Source

pub fn set_overlay_action_handler( &mut self, handler: impl Fn(InputOverlayKind, Box<dyn Action>, &mut Window, &mut Context<'_, InputBaseState<EditorMode>>) -> bool + 'static, )

Source

pub fn has_overlay_action_handler(&self) -> bool

Source

pub fn dismiss_completion_overlay(&mut self, cx: &mut Context<'_, Self>)

Source

pub fn dismiss_code_action_overlay(&mut self, cx: &mut Context<'_, Self>)

Source

pub fn insert_completion( &mut self, item: &CompletionItem, fallback_range: Range<usize>, window: &mut Window, cx: &mut Context<'_, Self>, )

Source

pub fn hover_popover(&self) -> Option<&HoverPopoverState>

Source

pub fn dismiss_lsp_overlays(&mut self, cx: &mut Context<'_, Self>)

Source§

impl InputBaseState<EditorMode>

Source

pub fn apply_lsp_edits( &mut self, text_edits: &Vec<TextEdit>, window: &mut Window, cx: &mut Context<'_, Self>, )

Apply a list of lsp_types::TextEdit to mutate the text.

Source§

impl<M: InputModeKind> InputBaseState<M>

Source

pub fn search_session(&self) -> &SearchSession

Source

pub fn is_replaceable(&self) -> bool

Returns true if the search panel can replace the matches.

This is false when the input is not replaceable, or when it is disabled or readonly.

Source

pub fn set_search_query( &mut self, query: impl Into<String>, case_insensitive: bool, cx: &mut Context<'_, Self>, )

Source

pub fn next_search_match( &mut self, cx: &mut Context<'_, Self>, ) -> Option<Range<usize>>

Source

pub fn previous_search_match( &mut self, cx: &mut Context<'_, Self>, ) -> Option<Range<usize>>

Source

pub fn replace_current_search_match( &mut self, replacement: &str, window: &mut Window, cx: &mut Context<'_, Self>, ) -> bool

Source

pub fn replace_all_search_matches( &mut self, replacement: &str, window: &mut Window, cx: &mut Context<'_, Self>, ) -> usize

Source§

impl<M: InputModeKind> InputBaseState<M>

Source

pub fn input_bounds(&self) -> Bounds<Pixels>

Source

pub fn text_bounds(&self) -> Option<Bounds<Pixels>>

Source

pub fn diagnostic_popover(&self) -> Option<Rc<DiagnosticEntry>>

Source

pub fn presentation(&self) -> InputPresentation

Source

pub fn is_multi_line(&self) -> bool

Source

pub fn is_single_line(&self) -> bool

Whether this input is a single-line text field. See Self::is_multi_line.

Source

pub fn is_code_editor(&self) -> bool

Whether this input is a source-code editor.

Source

pub fn is_copyable(&self) -> bool

Whether the user is allowed to copy the selection out.

A masked input keeps its value out of the clipboard.

Source

pub fn context_menu_capabilities(&self) -> InputContextMenuCapabilities

Source

pub fn set_text_align( &mut self, text_align: TextAlign, cx: &mut Context<'_, Self>, )

Source

pub fn toggle_masked(&mut self, _: &mut Window, cx: &mut Context<'_, Self>)

Flip the password mask.

Setting the mask is a single-line method, but flipping it stays here: the reveal button is rendered from the generic path, and it can only be switched on through crate::input::InputState anyway.

Source

pub fn on_context_menu( &mut self, handler: Rc<dyn Fn(NativeMenu, InputContextMenuCapabilities, Point<Pixels>, &mut Window, &mut App)>, )

Source

pub fn context_menu(self, enable: bool) -> Self

Sets whether the context menu that shows on right-click is enabled.

The context menu is enabled by default. This value is ignored if a custom context menu builder is defined on the input.

Source

pub fn set_context_menu_enabled(&mut self, enabled: bool)

Source

pub fn placeholder(self, placeholder: impl Into<SharedString>) -> Self

Set placeholder

Source

pub fn set_highlighter( &mut self, new_language: impl Into<SharedString>, cx: &mut Context<'_, Self>, )

Set highlighter language for for [LayoutMode::CodeEditor] mode.

Source

pub fn set_highlighter_factory( &mut self, factory: InputHighlighterFactory, cx: &mut Context<'_, Self>, )

Install the parser/highlighter adapter used by code-editor mode.

Source

pub fn ensure_highlighter_factory(&mut self, factory: InputHighlighterFactory)

Install a default adapter without replacing an application-provided one.

Source

pub fn set_editor_style(&mut self, style: InputEditorStyle)

Source

pub fn apply_highlighter_fold_candidates( &mut self, candidates: Vec<FoldRange>, cx: &mut Context<'_, Self>, )

Source

pub fn diagnostics(&self) -> Option<&DiagnosticSet>

Source

pub fn diagnostics_mut(&mut self) -> Option<&mut DiagnosticSet>

Source

pub fn set_placeholder( &mut self, placeholder: impl Into<SharedString>, _: &mut Window, cx: &mut Context<'_, Self>, )

Set placeholder

Source

pub fn set_value( &mut self, value: impl Into<SharedString>, window: &mut Window, cx: &mut Context<'_, Self>, )

Set the text of the input field.

For single-line inputs the caret is placed at the end of the text while the view is scrolled back to the start, so a long value shows its beginning instead of its tail (matching HTML <input>). Multi-line inputs reset the selection to 0..0.

Source

pub fn replace_all( &mut self, text: impl Into<SharedString>, window: &mut Window, cx: &mut Context<'_, Self>, )

Replace the entire text content while preserving undo history.

Unlike set_value, this method records the replacement in the undo stack, allowing the user to undo/redo the change. The selection is placed at the end of the new text for single-line inputs, or cleared (0..0) for multi-line inputs.

Use this when programmatically replacing the full text but the user should still be able to undo the operation — e.g. formatting.

Source

pub fn insert( &mut self, text: impl Into<SharedString>, window: &mut Window, cx: &mut Context<'_, Self>, )

Insert text at the current cursor position.

And the cursor will be moved to the end of inserted text.

Source

pub fn replace( &mut self, text: impl Into<SharedString>, window: &mut Window, cx: &mut Context<'_, Self>, )

Replace text at the current cursor position.

And the cursor will be moved to the end of replaced text.

Source

pub fn set_disabled(&mut self, disabled: bool, cx: &mut Context<'_, Self>)

Source

pub fn set_readonly(&mut self, readonly: bool, cx: &mut Context<'_, Self>)

Source

pub fn is_editable(&self) -> bool

Returns true if the user is allowed to change the text.

This is false when the input is disabled or readonly, the programmatic APIs (e.g.: Self::set_value, Self::insert) are not limited by this.

Source

pub fn clean_on_escape(self) -> Self

Set true to clear the input by pressing Escape key.

Source

pub fn set_clean_on_escape(&mut self, clean: bool)

Source

pub fn set_submit_on_enter(&mut self, submit: bool, cx: &mut Context<'_, Self>)

Source

pub fn set_show_whitespaces( &mut self, show: bool, _: &mut Window, cx: &mut Context<'_, Self>, )

Update whether to show whitespace characters.

Source

pub fn scroll_beyond_last_line(self, rows: Option<usize>) -> Self

Empty rows reserved below the last line of content (“scroll beyond last line”), code-editor mode only. Mirrors VSCode’s editor.scrollBeyondLastLine / Zed’s scroll_beyond_last_line.

  • None (default): half the viewport, floored at [BOTTOM_MARGIN_ROWS] line-heights.
  • Some(0): no trailing space; the cursor sits flush with the last row at scroll-max.
  • Some(n): exactly n rows.
Source

pub fn set_scroll_beyond_last_line( &mut self, rows: Option<usize>, _: &mut Window, cx: &mut Context<'_, Self>, )

Update Self::scroll_beyond_last_line after construction.

Source

pub fn cursor_surrounding_lines(self, lines: Option<usize>) -> Self

Minimum number of lines the cursor is kept clear of the viewport’s top/bottom edge before auto-scroll engages. Mirrors VSCode’s editor.cursorSurroundingLines / Zed’s vertical_scroll_margin. Orthogonal to Self::scroll_beyond_last_line, which sizes the empty region; this controls the cursor’s resting distance from the edge.

  • None (default): [BOTTOM_MARGIN_ROWS] lines, falling back to one line on small viewports.
  • Some(n): exactly n lines, clamped to half the viewport.
Source

pub fn set_cursor_surrounding_lines( &mut self, lines: Option<usize>, _: &mut Window, cx: &mut Context<'_, Self>, )

Update Self::cursor_surrounding_lines after construction.

Source

pub fn default_value(self, value: impl Into<SharedString>) -> Self

Set the default value of the input field.

Source

pub fn value(&self) -> SharedString

Return the value of the input field as an owned string.

The string is materialized on each call. See Self::text for the Rope the state owns, which is borrowed and costs nothing to read.

Source

pub fn selected_value(&self) -> SharedString

Return the portion of the value within the input field that is selected by the user, as an owned string.

The string is materialized on each call. See Self::selected_text for the same selection borrowed out of the Rope the state owns.

Source

pub fn unmask_value(&self) -> SharedString

Return the value without mask.

Source

pub fn text(&self) -> &Rope

Return the text Rope of the input field.

Borrowed from the state, so reading even a large document copies nothing. See Self::value when an owned string is wanted.

Source

pub fn cursor_position(&self) -> Position

Return the (0-based) Position of the cursor.

Source

pub fn set_cursor_position( &mut self, position: impl Into<Position>, window: &mut Window, cx: &mut Context<'_, Self>, )

Set (0-based) Position of the cursor.

This will move the cursor to the specified line and column, and update the selection range.

Source

pub fn focus(&self, window: &mut Window, cx: &mut Context<'_, Self>)

Focus the input field.

Source

pub fn refresh(&mut self, cx: &mut Context<'_, Self>)

Refresh the input, so the next render re-runs syntax highlighting and the LSP providers, not just a redraw.

Assigning the lsp providers (or other render-affecting state) at runtime does not take effect until the text next changes. Call this afterwards to force the refresh on the next render.

input.update(cx, |state, cx| {
    state.extras.lsp.hover_provider = Some(provider);
    state.refresh(cx);
});
Source

pub fn clean(&mut self, window: &mut Window, cx: &mut Context<'_, Self>)

Source

pub fn cursor(&self) -> usize

Get byte offset of the cursor.

The offset is the UTF-8 offset.

Source

pub fn visible_row_range(&self) -> Option<Range<usize>>

Visible row range in the last laid-out viewport, None before first layout.

Source

pub fn scroll_offset(&self) -> Point<Pixels>

Current scroll offset of the editor viewport.

Source

pub fn set_scroll_offset( &mut self, offset: Point<Pixels>, cx: &mut Context<'_, Self>, )

Set scroll offset of the editor viewport.

The offset will be clamped to the valid range, and applied after the next layout.

Source

pub fn line_height(&self) -> Option<Pixels>

Laid-out line height; None before first layout.

Source

pub fn selected_range(&self) -> Range<usize>

Returns the current selection as a byte range into the text.

The range is empty (start == end) when no text is selected; in that case the offset equals cursor(). Byte offsets are measured in the underlying rope’s byte units.

Source

pub fn select_all(&mut self, _: &mut Window, cx: &mut Context<'_, Self>)

Source

pub fn set_selected_range( &mut self, range: Range<usize>, cx: &mut Context<'_, Self>, )

Set the selected range using UTF-8 byte offsets.

Non-empty ranges expand to character boundaries. Empty ranges remain empty and are clipped to the preceding character boundary.

Source

pub fn unselect(&mut self, _: &mut Window, cx: &mut Context<'_, Self>)

Unselects the currently selected text.

Source

pub fn mask_pattern(self, pattern: impl Into<MaskPattern>) -> Self

Set the mask pattern for formatting the input text.

The pattern can contain:

  • 9: Any digit or dot
  • A: Any letter
  • *: Any character
  • Other characters will be treated as literal mask characters

Example: “(999)999-999” for phone numbers

Source

pub fn set_mask_pattern( &mut self, pattern: impl Into<MaskPattern>, _: &mut Window, cx: &mut Context<'_, Self>, )

Source

pub fn ensure_number_mask(&mut self)

Apply the default numeric mask unless the caller explicitly selected a mask.

Source

pub fn selected_text(&self) -> RopeSlice<'_>

Return the selected portion of the text, borrowed out of the Rope the state owns.

See Self::selected_value when an owned string is wanted.

Source

pub fn range_to_bounds(&self, range: &Range<usize>) -> Option<Bounds<Pixels>>

Return the rendered bounds for a UTF-8 byte range in the current input contents.

Returns None when the requested range is not currently laid out or visible.

Source§

impl InputBaseState<InputMode>

Methods that only a single-line input offers.

Source

pub fn new(window: &mut Window, cx: &mut Context<'_, Self>) -> Self

Create a single-line text input state.

Source

pub fn step_by( self, f: impl Fn(f64, StepAction, &mut App) -> f64 + 'static, ) -> Self

Set a custom step function of the [super::NumberInput].

The f receives the current value and the StepAction, and returns the step to apply, so the step can vary with the value.

§Example
// At the boundary 1.0 the step is 0.1 going down and 0.5 going up.
InputState::new(window, cx).step_by(|value, action, _cx| match action {
    StepAction::Increment => if value < 1.0 { 0.1 } else { 0.5 },
    StepAction::Decrement => if value <= 1.0 { 0.1 } else { 0.5 },
})
Source

pub fn masked(self, masked: bool) -> Self

Set with password masked state.

Source

pub fn set_masked( &mut self, masked: bool, _: &mut Window, cx: &mut Context<'_, Self>, )

Set the password masked state of the input field.

Source

pub fn pattern(self, pattern: Regex) -> Self

Set the regular expression pattern of the input field.

Source

pub fn set_pattern( &mut self, pattern: Regex, _window: &mut Window, _cx: &mut Context<'_, Self>, )

Set the regular expression pattern of the input field with reference.

Source

pub fn validate(self, f: impl Fn(&str, &mut App) -> bool + 'static) -> Self

Set the validation function of the input field.

Source

pub fn set_validator( &mut self, validate: impl Fn(&str, &mut App) -> bool + 'static, _cx: &mut Context<'_, Self>, )

Source

pub fn step(self, step: impl Into<NumberStep>) -> Self

Set the step value of the [super::NumberInput] for increment/decrement.

If any of step, min, max is set, the [super::NumberInput] will update the value internally (step by step, default 1, clamp to the min/max range and emit InputEvent::Change) instead of emitting super::NumberInputEvent::Step.

See also Self::step_by to calculate the step value based on the current value.

Source

pub fn min(self, min: f64) -> Self

Set the minimum value of the [super::NumberInput].

The value will be clamped to the minimum value on stepping and on blur (only if the clamped value passes the pattern/validate check). See also Self::step.

Source

pub fn max(self, max: f64) -> Self

Set the maximum value of the [super::NumberInput].

The value will be clamped to the maximum value on stepping and on blur (only if the clamped value passes the pattern/validate check). See also Self::step.

Source

pub fn set_step( &mut self, step: impl Into<Option<NumberStep>>, _: &mut Window, _: &mut Context<'_, Self>, )

Update the step value after construction, None to fall back to emitting super::NumberInputEvent::Step (if min, max are unset).

See Self::step and Self::step_by.

Source

pub fn set_min( &mut self, min: Option<f64>, _: &mut Window, _: &mut Context<'_, Self>, )

Update the minimum value after construction. See Self::min.

Source

pub fn set_max( &mut self, max: Option<f64>, _: &mut Window, _: &mut Context<'_, Self>, )

Update the maximum value after construction. See Self::max.

Source

pub fn set_loading( &mut self, loading: bool, _: &mut Window, cx: &mut Context<'_, Self>, )

Set true to show spinner at the input right.

Source§

impl<M: MultiLineMode> InputBaseState<M>

Methods shared by the two multi-line modes, and reachable on neither a single-line input nor anything else.

Source

pub fn set_searchable(&mut self, searchable: bool, cx: &mut Context<'_, Self>)

Source

pub fn set_soft_wrap( &mut self, wrap: bool, _: &mut Window, cx: &mut Context<'_, Self>, )

Update the soft wrap mode, default is true.

Source

pub fn set_wrapping_indent( &mut self, wrapping_indent: WrappingIndent, _: &mut Window, cx: &mut Context<'_, Self>, )

Update how soft-wrapped continuation lines are indented.

Source§

impl InputBaseState<TextareaMode>

Methods that only ordinary multi-line text offers.

Source

pub fn new(window: &mut Window, cx: &mut Context<'_, Self>) -> Self

Create a multi-line text state.

Being multi-line is carried by the mode, not by the layout, so the default plain-text layout needs no adjustment here.

Source

pub fn set_auto_grow( &mut self, min_rows: usize, max_rows: usize, cx: &mut Context<'_, Self>, )

Source

pub fn set_rows(&mut self, rows: usize, cx: &mut Context<'_, Self>)

Source

pub fn auto_grow(self, min_rows: usize, max_rows: usize) -> Self

Grow with the content from min_rows through max_rows.

Source§

impl InputBaseState<EditorMode>

Methods that only a source-code editor offers.

Source

pub fn new(window: &mut Window, cx: &mut Context<'_, Self>) -> Self

Create a source-code editor state.

Default options: line numbers on, tab size 2 with soft tabs, indent guides on, multi-line, and search enabled. Set the language for syntax highlighting with Self::language; without one the text is shown unhighlighted.

The editor aims at simple code editing or display, not at being a full-featured code editor. It offers syntax highlighting, auto indent, line numbers, and handles large text up to about 50K lines.

Source

pub fn language(self, language: impl Into<SharedString>) -> Self

Set the language to highlight, e.g. "rust".

See Self::set_highlighter to change it after construction.

Source

pub fn set_folding( &mut self, folding: bool, _: &mut Window, cx: &mut Context<'_, Self>, )

Set code folding at runtime.

When disabling, all existing folds are cleared.

Source

pub fn unfold_at( &mut self, position: impl Into<Position>, cx: &mut Context<'_, Self>, ) -> bool

Unfold any folded ranges that hide the given position.

Use this to reveal a position before acting on it (e.g. before Self::set_cursor_position, which stops at a fold boundary), without touching folds elsewhere in the buffer. Fold candidates are kept, so the opened ranges can be folded again from the gutter.

A fold keeps its own first and last line visible, so a position on either of them opens nothing. Nested folds all open, since opening only the outermost would leave the position hidden.

Returns whether any fold was opened.

Source

pub fn set_line_number( &mut self, line_number: bool, _: &mut Window, cx: &mut Context<'_, Self>, )

Set line number.

Trait Implementations§

Source§

impl<M: InputModeKind> EntityInputHandler for InputBaseState<M>

Source§

fn replace_text_in_range( &mut self, range_utf16: Option<Range<usize>>, new_text: &str, window: &mut Window, cx: &mut Context<'_, Self>, )

Replace text in range.

  • If the new text is invalid, it will not be replaced.
  • If range_utf16 is not provided, the current selected range will be used.
Source§

fn replace_and_mark_text_in_range( &mut self, range_utf16: Option<Range<usize>>, new_text: &str, new_selected_range_utf16: Option<Range<usize>>, window: &mut Window, cx: &mut Context<'_, Self>, )

Mark text is the IME temporary insert on typing.

Source§

fn bounds_for_range( &mut self, range_utf16: Range<usize>, bounds: Bounds<Pixels>, _window: &mut Window, _cx: &mut Context<'_, Self>, ) -> Option<Bounds<Pixels>>

Used to position IME candidates.

Source§

fn text_for_range( &mut self, range_utf16: Range<usize>, adjusted_range: &mut Option<Range<usize>>, _window: &mut Window, _cx: &mut Context<'_, Self>, ) -> Option<String>

Source§

fn selected_text_range( &mut self, _ignore_disabled_input: bool, _window: &mut Window, _cx: &mut Context<'_, Self>, ) -> Option<UTF16Selection>

Source§

fn marked_text_range( &self, _window: &mut Window, _cx: &mut Context<'_, Self>, ) -> Option<Range<usize>>

Source§

fn unmark_text(&mut self, _window: &mut Window, _cx: &mut Context<'_, Self>)

Source§

fn character_index_for_point( &mut self, point: Point<Pixels>, _window: &mut Window, _cx: &mut Context<'_, Self>, ) -> Option<usize>

Source§

fn paste( &mut self, item: ClipboardItem, window: &mut Window, cx: &mut Context<'_, Self>, )

See InputHandler::paste for details
Source§

fn set_selected_text_range( &mut self, _range_utf16: Range<usize>, _window: &mut Window, _cx: &mut Context<'_, Self>, )

Source§

fn text_length_utf16( &mut self, _window: &mut Window, _cx: &mut Context<'_, Self>, ) -> Option<usize>

Source§

fn accepts_text_input( &self, _window: &mut Window, _cx: &mut Context<'_, Self>, ) -> bool

Source§

fn text_input_configuration( &mut self, _window: &mut Window, _cx: &mut Context<'_, Self>, ) -> TextInputConfiguration

Source§

fn text_input_editable_range( &mut self, _window: &mut Window, _cx: &mut Context<'_, Self>, ) -> Option<Range<usize>>

Source§

impl<M: InputModeKind> EventEmitter<InputEvent> for InputBaseState<M>

Source§

impl<M: InputModeKind> Focusable for InputBaseState<M>

Source§

fn focus_handle(&self, _cx: &App) -> FocusHandle

Returns the focus handle associated with this view.
Source§

impl<M: InputModeKind> Render for InputBaseState<M>

Source§

fn render( &mut self, window: &mut Window, cx: &mut Context<'_, Self>, ) -> impl IntoElement

Render this view into an element tree.

Auto Trait Implementations§

§

impl<M> !Freeze for InputBaseState<M>

§

impl<M> !RefUnwindSafe for InputBaseState<M>

§

impl<M> !Send for InputBaseState<M>

§

impl<M> !Sync for InputBaseState<M>

§

impl<M> !UnwindSafe for InputBaseState<M>

§

impl<M> Unpin for InputBaseState<M>
where <M as InputModeKind>::Extras: Unpin, Option<Rc<dyn Fn(InputOverlayKind, Box<dyn Action>, &mut Window, &mut Context<'_, InputBaseState<M>>) -> bool>>: Unpin,

§

impl<M> UnsafeUnpin for InputBaseState<M>

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. 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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more