TableEditorState

Trait TableEditorState 

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

Source

type Context<'a>

Some external context.

Source

type Value: Clone

Type of data.

Source

type Err

Error type.

Required Methods§

Source

fn create_value<'a>( &self, ctx: &'a Self::Context<'a>, ) -> Result<Self::Value, Self::Err>

Create a fresh value with all the defaults.

Source

fn set_value<'a>( &mut self, value: Self::Value, ctx: &'a Self::Context<'a>, ) -> Result<(), Self::Err>

Set the current value for the editor.

Source

fn value<'a>( &mut self, ctx: &'a Self::Context<'a>, ) -> Result<Option<Self::Value>, Self::Err>

Return the current value from the editor.

Source

fn focused_col(&self) -> Option<usize>

Returns the currently focused column. Used to scroll the column to fully visible.

Source

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.

Implementors§