pub trait TableEditorState: HasFocus {
type Context<'a>;
type Value: Clone;
type Err;
// Required methods
fn create_value<'a>(
&self,
ctx: &'a Self::Context<'a>,
) -> Result<Self::Value, Self::Err>;
fn set_value<'a>(
&mut self,
value: Self::Value,
ctx: &'a Self::Context<'a>,
) -> Result<(), Self::Err>;
fn value<'a>(
&mut self,
ctx: &'a Self::Context<'a>,
) -> Result<Option<Self::Value>, Self::Err>;
fn focused_col(&self) -> Option<usize>;
fn set_focused_col(&self, col: usize);
}Expand description
Trait for the editor widget state
Required Associated Types§
Required Methods§
Sourcefn create_value<'a>(
&self,
ctx: &'a Self::Context<'a>,
) -> Result<Self::Value, Self::Err>
fn create_value<'a>( &self, ctx: &'a Self::Context<'a>, ) -> Result<Self::Value, Self::Err>
Create a fresh value with all the defaults.
Sourcefn set_value<'a>(
&mut self,
value: Self::Value,
ctx: &'a Self::Context<'a>,
) -> Result<(), Self::Err>
fn set_value<'a>( &mut self, value: Self::Value, ctx: &'a Self::Context<'a>, ) -> Result<(), Self::Err>
Set the current value for the editor.
Sourcefn value<'a>(
&mut self,
ctx: &'a Self::Context<'a>,
) -> Result<Option<Self::Value>, Self::Err>
fn value<'a>( &mut self, ctx: &'a Self::Context<'a>, ) -> Result<Option<Self::Value>, Self::Err>
Return the current value from the editor.
Sourcefn focused_col(&self) -> Option<usize>
fn focused_col(&self) -> Option<usize>
Returns the currently focused column. Used to scroll the column to fully visible.
Sourcefn set_focused_col(&self, col: usize)
fn set_focused_col(&self, col: usize)
Allows setting the focus for the editor.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.