Skip to main content

TextInputState

Struct TextInputState 

Source
pub struct TextInputState<P = TextInputProvider>{ /* private fields */ }
Expand description

Single-line text input widget state.

Wraps a single-field TextFormState. Editing, cursor, and movement methods from the form are available directly, and the form can be reached explicitly via TextInputState::form / TextInputState::form_mut. With the validation and computed features enabled, the corresponding helper methods are re-exposed as inherent methods on this type.

Implementations§

Source§

impl<P> TextInputState<P>

Source

pub fn with_provider(provider: P) -> TextInputState<P>

Source

pub fn from_text<S>(text: S) -> TextInputState<P>
where S: Into<String>,

Source

pub fn text(&self) -> String

Source

pub fn set_text<S>(&mut self, text: S)
where S: Into<String>,

Source

pub fn set_placeholder<S>(&mut self, s: S)
where S: Into<String>,

Source

pub fn suggestion_suffix(&self) -> Option<&str>

Source

pub fn set_suggestion_suffix<S>(&mut self, suffix: S)
where S: Into<String>,

Source

pub fn clear_suggestion_suffix(&mut self)

Source

pub fn accept_suggestion_suffix(&mut self) -> TextInputEventOutcome

Source

pub fn set_overflow_indicator(&mut self, ch: char)

Source

pub fn paste(&mut self, text: &str) -> TextInputEventOutcome

Source

pub fn update_cursor_style(&self) -> Result<(), Error>

Update terminal cursor style for this single-line input.

Follows the editor’s current mode so that Helix/Vim-style modal editing produces the correct cursor: a steady block in normal mode, a beam in insert mode, and a blinking block for selections.

Source

pub fn handle_event(&mut self, event: Event) -> TextInputEventOutcome

Source

pub fn input(&mut self, key: KeyEvent) -> TextInputEventOutcome

Source

pub fn cursor(&self, area: Rect, block: Option<&Block<'_>>) -> (u16, u16)

Source§

impl<P> TextInputState<P>

Source

pub fn form(&self) -> &TextFormState<P>

Borrow the underlying TextFormState.

Source

pub fn form_mut(&mut self) -> &mut TextFormState<P>

Mutably borrow the underlying TextFormState.

Source

pub fn current_field(&self) -> usize

Source

pub fn cursor_position(&self) -> usize

Source

pub fn current_text(&self) -> &str

Source

pub fn mode(&self) -> AppMode

Source

pub fn ui_state(&self) -> &EditorState

Source

pub fn data_provider(&self) -> &P

Source

pub fn data_provider_mut(&mut self) -> &mut P

Source

pub fn move_left(&mut self) -> Result<(), Error>

Source

pub fn move_right(&mut self) -> Result<(), Error>

Source

pub fn move_line_start(&mut self)

Source

pub fn move_line_end(&mut self)

Source

pub fn set_cursor_position(&mut self, position: usize)

Source

pub fn enter_edit_mode(&mut self)

Source

pub fn exit_edit_mode(&mut self) -> Result<(), Error>

Source

pub fn insert_char(&mut self, ch: char) -> Result<(), Error>

Source

pub fn insert_text(&mut self, text: &str) -> Result<(), Error>

Source

pub fn set_current_field_value(&mut self, value: String)

Source

pub fn delete_backward(&mut self) -> Result<(), Error>

Source

pub fn delete_forward(&mut self) -> Result<(), Error>

Source

pub fn move_word_next(&mut self)

Move to the start of the next word.

Source

pub fn move_word_prev(&mut self)

Move to the start of the previous word.

Source

pub fn move_word_end(&mut self)

Move to the end of the current/next word.

Source

pub fn move_word_end_prev(&mut self)

Move to the end of the previous word.

Source

pub fn move_big_word_next(&mut self)

Move to the start of the next WORD (whitespace-delimited, vim W).

Source

pub fn move_big_word_prev(&mut self)

Move to the start of the previous WORD (vim B).

Source

pub fn move_big_word_end(&mut self)

Move to the end of the current/next WORD (vim E).

Source

pub fn move_big_word_end_prev(&mut self)

Move to the end of the previous WORD (vim gE).

Source

pub fn enter_append_mode(&mut self)

Enter edit mode with the cursor positioned for append (vim a).

Source

pub fn current_display_text(&self) -> String

The current field’s display text (mask/formatter-aware when the validation feature is enabled; otherwise the raw text).

Source

pub fn display_cursor_position(&self) -> usize

Cursor position in display coordinates (accounts for a display mask).

Source§

impl<P> TextInputState<P>

Validation helpers, re-exposed from the underlying TextFormState so they are part of TextInputState’s own public API.

Source

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

Source

pub fn is_validation_enabled(&self) -> bool

Source

pub fn set_field_validation( &mut self, field_index: usize, config: ValidationConfig, )

Source

pub fn remove_field_validation(&mut self, field_index: usize)

Source

pub fn validate_current_field(&mut self) -> ValidationResult

Source

pub fn validate_field(&mut self, field_index: usize) -> Option<ValidationResult>

Source

pub fn clear_validation_results(&mut self)

Source

pub fn validation_summary(&self) -> ValidationSummary

Source

pub fn can_switch_fields(&self) -> bool

Source

pub fn field_switch_block_reason(&self) -> Option<String>

Source

pub fn last_switch_block(&self) -> Option<&str>

Source

pub fn current_limits_status_text(&self) -> Option<String>

Source

pub fn current_formatter_warning(&self) -> Option<String>

Source

pub fn external_validation_of( &self, field_index: usize, ) -> ExternalValidationState

Source

pub fn clear_all_external_validation(&mut self)

Source

pub fn clear_external_validation(&mut self, field_index: usize)

Source

pub fn set_external_validation( &mut self, field_index: usize, state: ExternalValidationState, )

Source

pub fn set_external_validation_callback<F>(&mut self, callback: F)
where F: FnMut(usize, &str) -> ExternalValidationState + Send + Sync + 'static,

Source§

impl<P> TextInputState<P>

Computed-field helpers, re-exposed from the underlying TextFormState.

Source

pub fn register_computed_provider<C>(&mut self, provider: &C)

Source

pub fn set_computed_provider<C>(&mut self, provider: C)

Source

pub fn recompute_fields<C>(&mut self, provider: &mut C, field_indices: &[usize])

Source

pub fn recompute_all_fields<C>(&mut self, provider: &mut C)

Source

pub fn on_field_changed<C>(&mut self, provider: &mut C, changed_field: usize)

Source

pub fn effective_field_value(&self, field_index: usize) -> String

Source§

impl<P> TextInputState<P>

Undo/redo, re-exposed from the underlying TextFormState.

Source

pub fn undo(&mut self) -> bool

Source

pub fn redo(&mut self) -> bool

Source

pub fn can_undo(&self) -> bool

Source

pub fn can_redo(&self) -> bool

Source

pub fn clear_history(&mut self)

Source

pub fn set_history_limit(&mut self, limit: usize)

Source§

impl<P> TextInputState<P>

Dropdown suggestions, re-exposed from the underlying TextFormState so that TextInput, TextArea, and TextFormState all share one suggestions mechanism. Render the dropdown with canvas::suggestions::render::render_suggestions_dropdown(.., self.form()).

This is distinct from the lightweight inline-suffix completion (TextInputState::set_suggestion_suffix), which TextInput also offers.

Source

pub fn open_suggestions(&mut self, field_index: usize)

Source

pub fn check_suggestion_trigger(&mut self)

Source

pub fn trigger_suggestions(&mut self) -> Option<(usize, String)>

Source

pub fn apply_suggestions(&mut self, items: Vec<SuggestionItem>)

Source

pub fn update_suggestions(&mut self, items: Vec<SuggestionItem>)

Source

pub fn dismiss_suggestions(&mut self)

Source

pub fn cancel_suggestions(&mut self)

Source

pub fn suggestions_next(&mut self)

Source

pub fn suggestions_prev(&mut self)

Source

pub fn apply_suggestion(&mut self) -> Option<String>

Source

pub fn is_suggestions_active(&self) -> bool

Source

pub fn is_suggestions_loading(&self) -> bool

Source

pub fn dropdown_suggestions(&self) -> &[SuggestionItem]

Methods from Deref<Target = TextFormState<P>>§

Source

pub fn core(&self) -> &EditorCore<D>

Source

pub fn fixed_field_count(&self) -> usize

Source

pub fn handle_event(&mut self, event: Event) -> TextFormEventOutcome

Source

pub fn paste(&mut self, text: &str) -> TextFormEventOutcome

Source

pub fn input(&mut self, key: KeyEvent) -> TextFormEventOutcome

Source

pub fn handle_key_event(&mut self, evt: KeyEvent) -> KeyEventOutcome

Source

pub fn is_sequence_pending(&self) -> bool

Whether a multi-key command (key sequence, count, or pending operator) is in flight, so a host should keep routing keys here rather than letting an outer keymap claim the next stroke.

Source

pub fn update_cursor_style(&self) -> Result<(), Error>

Source

pub fn cursor(&self, area: Rect, block: Option<&Block<'_>>) -> (u16, u16)

Source

pub fn use_keybinding_preset(&mut self, preset: BuiltinCanvasKeybindingPreset)

Source

pub fn set_keybindings(&mut self, keybindings: CanvasKeyBindings)

Source

pub fn clear_current_field(&mut self)

Source

pub fn clear_field(&mut self, field_index: usize)

Source

pub fn clear_current_and_following_fields(&mut self, count: usize)

Source

pub fn change_current_field(&mut self)

Source

pub fn delete_to_field_end(&mut self)

Source

pub fn execute(&mut self, action: CanvasAction) -> ActionResult

Source

pub fn undo(&mut self) -> bool

Source

pub fn redo(&mut self) -> bool

Methods from Deref<Target = EditorCore<D>>§

Source

pub fn execute(&mut self, action: CanvasAction) -> ActionResult

Execute a CanvasAction on this editor instance.

Source

pub fn set_keybindings(&mut self, keybindings: CanvasKeyBindings)

Set the keybindings for this editor instance.

Source

pub fn set_keybinding_preset(&mut self, preset: BuiltinCanvasKeybindingPreset)

Install a built-in keybinding preset and its editing paradigm.

Source

pub fn has_keybindings(&self) -> bool

Check if this editor has keybindings configured.

Source

pub fn set_key_sequence_timeout_ms(&mut self, timeout_ms: u64)

Set the timeout for multi-key sequences (in milliseconds)

Source

pub fn current_text(&self) -> &str

Source

pub fn current_field(&self) -> usize

Source

pub fn cursor_position(&self) -> usize

Source

pub fn mode(&self) -> AppMode

Source

pub fn is_suggestions_active(&self) -> bool

Source

pub fn ui_state(&self) -> &EditorState

Source

pub fn data_provider(&self) -> &D

Source

pub fn data_provider_mut(&mut self) -> &mut D

Source

pub fn suggestions(&self) -> &[SuggestionItem]

Source

pub fn validation_state(&self) -> &ValidationState

Source

pub fn cleanup_cursor(&self) -> Result<(), Error>

Source

pub fn current_display_text(&self) -> String

Get current field text for display.

Source

pub fn display_text_for_field(&self, field_index: usize) -> String

Get effective display text for any field index (Feature 4 + masks).

Source

pub fn display_cursor_position(&self) -> usize

Map raw cursor to display position (formatter/mask aware).

Source

pub fn open_line_below(&mut self) -> Result<(), Error>

Open new line below (vim o)

Source

pub fn open_line_above(&mut self) -> Result<(), Error>

Open new line above (vim O)

Source

pub fn insert_char(&mut self, ch: char) -> Result<(), Error>

Handle character insertion (mask/limit-aware)

Source

pub fn insert_text(&mut self, text: &str) -> Result<(), Error>

Insert plain text at the current cursor position.

This intentionally treats the input as a character stream and reuses insert_char so validation, masking, and suggestions continue to flow through the existing editing logic.

Source

pub fn delete_backward(&mut self) -> Result<(), Error>

Delete backward (backspace)

Source

pub fn delete_forward(&mut self) -> Result<(), Error>

Delete forward (Delete key)

Source

pub fn enter_append_mode(&mut self)

Enter edit mode with cursor positioned for append (vim ‘a’)

Source

pub fn set_current_field_value(&mut self, value: String)

Set current field value (validates under feature flag)

Source

pub fn set_field_value(&mut self, field_index: usize, value: String)

Set specific field value by index (validates under feature flag)

Source

pub fn clear_current_field(&mut self)

Clear the current field

Source

pub fn undo(&mut self) -> bool

Undo the most recent edit (or run). Returns false if there is nothing to undo.

Source

pub fn redo(&mut self) -> bool

Redo the most recently undone edit. Returns false if there is nothing to redo.

Source

pub fn can_undo(&self) -> bool

Whether there is any edit to undo.

Source

pub fn can_redo(&self) -> bool

Whether there is any undone edit to redo.

Source

pub fn clear_history(&mut self)

Clear all undo/redo history.

Source

pub fn set_history_limit(&mut self, limit: usize)

Set the maximum number of retained undo steps (oldest dropped first).

Source

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

Enable or disable undo/redo history capture (enabled by default).

While disabled, edits do not record checkpoints, so apps that don’t want undo — or want to avoid the per-edit snapshot cost — can switch it off. Existing history is cleared when disabling.

Source

pub fn is_history_enabled(&self) -> bool

Whether undo/redo history capture is currently enabled.

Source

pub fn update_inline_completion(&mut self)

Update UI state’s completion text from current selection

Source

pub fn open_suggestions(&mut self, field_index: usize)

Open the suggestions UI for field_index

Source

pub fn trigger_suggestions(&mut self) -> Option<(usize, String)>

Trigger suggestions - opens UI and returns request info for client to fetch data. Client should fetch data and call apply_suggestions(). Returns Some((field_index, query)) if suggestions can be triggered, None otherwise.

Source

pub fn apply_suggestions(&mut self, items: Vec<SuggestionItem>)

Apply fetched suggestions from client - opens UI with the provided items.

Source

pub fn update_suggestions(&mut self, items: Vec<SuggestionItem>)

Update suggestions with new query results - adjusts selection if needed.

Source

pub fn dismiss_suggestions(&mut self)

Dismiss suggestions - closes UI and clears data.

Source

pub fn check_suggestion_trigger(&mut self)

Check suggestion trigger condition and update suggestions accordingly. This is called automatically when entering insert mode or changing text.

Source

pub fn handle_escape_readonly(&mut self)

Handle Escape key in normal mode (closes suggestions if active)

Source

pub fn cancel_suggestions(&mut self)

Source

pub fn suggestions_next(&mut self)

Source

pub fn suggestions_prev(&mut self)

Source

pub fn apply_suggestion(&mut self) -> Option<String>

Source

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

Source

pub fn is_validation_enabled(&self) -> bool

Source

pub fn set_field_validation( &mut self, field_index: usize, config: ValidationConfig, )

Source

pub fn remove_field_validation(&mut self, field_index: usize)

Source

pub fn validate_current_field(&mut self) -> ValidationResult

Source

pub fn validate_field(&mut self, field_index: usize) -> Option<ValidationResult>

Source

pub fn clear_validation_results(&mut self)

Source

pub fn validation_summary(&self) -> ValidationSummary

Source

pub fn can_switch_fields(&self) -> bool

Source

pub fn field_switch_block_reason(&self) -> Option<String>

Source

pub fn last_switch_block(&self) -> Option<&str>

Source

pub fn current_limits_status_text(&self) -> Option<String>

Source

pub fn current_formatter_warning(&self) -> Option<String>

Source

pub fn external_validation_of( &self, field_index: usize, ) -> ExternalValidationState

Source

pub fn clear_all_external_validation(&mut self)

Source

pub fn clear_external_validation(&mut self, field_index: usize)

Source

pub fn set_external_validation( &mut self, field_index: usize, state: ExternalValidationState, )

Source

pub fn set_external_validation_callback<F>(&mut self, callback: F)
where F: FnMut(usize, &str) -> ExternalValidationState + Send + Sync + 'static,

Source

pub fn register_computed_provider<C>(&mut self, provider: &C)

Source

pub fn set_computed_provider<C>(&mut self, provider: C)

Source

pub fn recompute_fields<C>(&mut self, provider: &mut C, field_indices: &[usize])

Source

pub fn recompute_all_fields<C>(&mut self, provider: &mut C)

Source

pub fn on_field_changed<C>(&mut self, provider: &mut C, changed_field: usize)

Source

pub fn effective_field_value(&self, field_index: usize) -> String

Source

pub fn set_mode(&mut self, mode: AppMode)

Change mode

Source

pub fn exit_edit_mode(&mut self) -> Result<(), Error>

Exit insert mode to normal mode

Source

pub fn enter_edit_mode(&mut self)

Enter insert mode

Source

pub fn enter_highlight_mode(&mut self)

Source

pub fn enter_highlight_line_mode(&mut self)

Source

pub fn exit_highlight_mode(&mut self)

Source

pub fn is_highlight_mode(&self) -> bool

Source

pub fn selection_state(&self) -> &SelectionState

Source

pub fn move_left_with_selection(&mut self)

Source

pub fn move_right_with_selection(&mut self)

Source

pub fn move_up_with_selection(&mut self)

Source

pub fn move_down_with_selection(&mut self)

Source

pub fn move_word_next_with_selection(&mut self)

Source

pub fn move_word_end_with_selection(&mut self)

Source

pub fn move_word_prev_with_selection(&mut self)

Source

pub fn move_word_end_prev_with_selection(&mut self)

Source

pub fn move_big_word_next_with_selection(&mut self)

Source

pub fn move_big_word_end_with_selection(&mut self)

Source

pub fn move_big_word_prev_with_selection(&mut self)

Source

pub fn move_big_word_end_prev_with_selection(&mut self)

Source

pub fn move_line_start_with_selection(&mut self)

Source

pub fn move_line_end_with_selection(&mut self)

Source

pub fn move_left(&mut self) -> Result<(), Error>

Move cursor left within current field (mask-aware)

Source

pub fn move_right(&mut self) -> Result<(), Error>

Move cursor right within current field (mask-aware)

Source

pub fn move_line_start(&mut self)

Move to start of current field (vim 0)

Source

pub fn move_line_end(&mut self)

Move to end of current field (vim $)

Source

pub fn set_cursor_position(&mut self, position: usize)

Set cursor to exact position (for f/F/t/T etc.)

Source

pub fn move_word_next(&mut self)

Move to start of next word (vim w) - can cross field boundaries

Source

pub fn move_word_prev(&mut self)

Move to start of previous word (vim b) - can cross field boundaries

Source

pub fn move_word_end(&mut self)

Move to end of current/next word (vim e) - can cross field boundaries

Source

pub fn move_word_end_prev(&mut self)

Move to end of previous word (vim ge) - can cross field boundaries

Source

pub fn move_big_word_next(&mut self)

Move to start of next big_word (vim W) - can cross field boundaries

Source

pub fn move_big_word_prev(&mut self)

Move to start of previous big_word (vim B) - can cross field boundaries

Source

pub fn move_big_word_end(&mut self)

Move to end of current/next big_word (vim E) - can cross field boundaries

Source

pub fn move_big_word_end_prev(&mut self)

Move to end of previous big_word (vim gE) - can cross field boundaries

Source

pub fn transition_to_field(&mut self, new_field: usize) -> Result<(), Error>

Source

pub fn move_first_line(&mut self) -> Result<(), Error>

Move to first line (vim gg)

Source

pub fn move_last_line(&mut self) -> Result<(), Error>

Move to last line (vim G)

Source

pub fn move_up(&mut self) -> bool

Move to previous field (vim k / up) Returns true if moved, false if already at top

Source

pub fn move_down(&mut self) -> bool

Move to next field (vim j / down) Returns true if moved, false if already at bottom

Source

pub fn move_to_next_field(&mut self) -> Result<(), Error>

Move to next field cyclic

Source

pub fn prev_field(&mut self) -> bool

Source

pub fn next_field(&mut self) -> bool

Trait Implementations§

Source§

impl<P> CanvasTextInputHost for TextInputState<P>

Source§

fn mode(&self) -> AppMode

Source§

fn text(&self) -> String

Source§

fn has_keybindings(&self) -> bool

Source§

fn install_keybindings(&mut self, bindings: CanvasKeyBindings)

Source§

fn is_sequence_pending(&self) -> bool

Whether a multi-key command is mid-flight, so the runtime keeps routing keys here instead of letting the global keymap claim the next stroke.
Source§

fn input_key(&mut self, key: KeyEvent) -> CanvasKeyDispatchOutcome

Source§

fn accept_suggestion_suffix(&mut self) -> bool

Accept the current inline-suggestion suffix (ghost text). Returns whether a non-empty suffix was inserted.
Source§

fn paste(&mut self, text: &str) -> bool

Insert pasted (bracketed-paste) text. Returns whether anything was inserted.
Source§

fn set_suggestion_suffix(&mut self, suffix: String)

Source§

fn clear_suggestion_suffix(&mut self)

Source§

fn exit_edit_mode(&mut self)

Source§

fn dispatch_canvas_action(&mut self, action: CanvasAction) -> HostActionOutcome

Source§

impl<P> Default for TextInputState<P>

Source§

fn default() -> TextInputState<P>

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

impl<P> Deref for TextInputState<P>

Source§

type Target = TextFormState<P>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &<TextInputState<P> as Deref>::Target

Dereferences the value.
Source§

impl<P> DerefMut for TextInputState<P>

Source§

fn deref_mut(&mut self) -> &mut <TextInputState<P> as Deref>::Target

Mutably dereferences the value.

Auto Trait Implementations§

§

impl<P = TextInputProvider> !RefUnwindSafe for TextInputState<P>

§

impl<P = TextInputProvider> !UnwindSafe for TextInputState<P>

§

impl<P> Freeze for TextInputState<P>
where P: Freeze,

§

impl<P> Send for TextInputState<P>
where P: Send,

§

impl<P> Sync for TextInputState<P>
where P: Sync,

§

impl<P> Unpin for TextInputState<P>
where P: Unpin,

§

impl<P> UnsafeUnpin for TextInputState<P>
where P: UnsafeUnpin,

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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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.
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