pub trait EditorState: FocusContainer {
type Context<'a>;
type Data;
type Err;
// Required methods
fn new_edit_data(
&self,
ctx: &Self::Context<'_>,
) -> Result<Self::Data, Self::Err>;
fn set_edit_data(
&mut self,
data: &Self::Data,
ctx: &Self::Context<'_>,
) -> Result<(), Self::Err>;
fn get_edit_data(
&mut self,
data: &mut Self::Data,
ctx: &Self::Context<'_>,
) -> Result<(), Self::Err>;
fn is_empty(&self) -> bool;
fn focused_col(&self) -> Option<usize>;
}Expand description
Trait for the editor widget state
Required Associated Types§
Required Methods§
sourcefn new_edit_data(
&self,
ctx: &Self::Context<'_>,
) -> Result<Self::Data, Self::Err>
fn new_edit_data( &self, ctx: &Self::Context<'_>, ) -> Result<Self::Data, Self::Err>
Create default data.
sourcefn set_edit_data(
&mut self,
data: &Self::Data,
ctx: &Self::Context<'_>,
) -> Result<(), Self::Err>
fn set_edit_data( &mut self, data: &Self::Data, ctx: &Self::Context<'_>, ) -> Result<(), Self::Err>
Set editing data.
sourcefn get_edit_data(
&mut self,
data: &mut Self::Data,
ctx: &Self::Context<'_>,
) -> Result<(), Self::Err>
fn get_edit_data( &mut self, data: &mut Self::Data, ctx: &Self::Context<'_>, ) -> Result<(), Self::Err>
Copy the editor state back to the data.
sourcefn focused_col(&self) -> Option<usize>
fn focused_col(&self) -> Option<usize>
Returns the currently focused column.
Object Safety§
This trait is not object safe.