rat_ftable::edit

Trait EditorState

Source
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§

Source

fn new_edit_data( &self, ctx: &Self::Context<'_>, ) -> Result<Self::Data, Self::Err>

Create default data.

Source

fn set_edit_data( &mut self, data: &Self::Data, ctx: &Self::Context<'_>, ) -> Result<(), Self::Err>

Set editing data.

Source

fn get_edit_data( &mut self, data: &mut Self::Data, ctx: &Self::Context<'_>, ) -> Result<(), Self::Err>

Copy the editor state back to the data.

Source

fn is_empty(&self) -> bool

Is this some empty state?

Source

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.

Implementors§