pub struct SnippetParamFormState {
pub params: Vec<SnippetParam>,
pub values: Vec<String>,
pub focused_index: usize,
pub cursor_pos: usize,
pub scroll_offset: usize,
pub visible_count: usize,
}Expand description
Form state for snippet parameter input.
Fields§
§params: Vec<SnippetParam>§values: Vec<String>§focused_index: usize§cursor_pos: usize§scroll_offset: usize§visible_count: usizeHow many params actually fit on screen (set by renderer).
Implementations§
Source§impl SnippetParamFormState
impl SnippetParamFormState
pub fn new(params: &[SnippetParam]) -> Self
pub fn insert_char(&mut self, c: char)
pub fn delete_char_before_cursor(&mut self)
Sourcepub fn values_map(&self) -> HashMap<String, String>
pub fn values_map(&self) -> HashMap<String, String>
Build a map of param name to user-entered value for substitution.
Trait Implementations§
Source§impl Clone for SnippetParamFormState
impl Clone for SnippetParamFormState
Source§fn clone(&self) -> SnippetParamFormState
fn clone(&self) -> SnippetParamFormState
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SnippetParamFormState
impl RefUnwindSafe for SnippetParamFormState
impl Send for SnippetParamFormState
impl Sync for SnippetParamFormState
impl Unpin for SnippetParamFormState
impl UnsafeUnpin for SnippetParamFormState
impl UnwindSafe for SnippetParamFormState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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