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.
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.