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.

Object Safety§

This trait is not object safe.

Implementors§