Trait modalkit::editing::application::ApplicationInfo

source ·
pub trait ApplicationInfo: Clone + Debug + Eq + PartialEq {
    type Error: ApplicationError;
    type Action: ApplicationAction;
    type Store: ApplicationStore;
    type WindowId: ApplicationWindowId;
    type ContentId: ApplicationContentId;

    // Required method
    fn content_of_command(cmdtype: CommandType) -> Self::ContentId;

    // Provided method
    fn complete(
        text: &EditRope,
        cursor: &mut Cursor,
        content: &Self::ContentId,
        store: &mut Store<Self>
    ) -> Vec<String> { ... }
}
Expand description

Trait for objects that describe application-specific behaviour and types.

Required Associated Types§

source

type Error: ApplicationError

An application-specific error type.

source

type Action: ApplicationAction

The type for application-specific actions.

source

type Store: ApplicationStore

The type for application-specific storage.

source

type WindowId: ApplicationWindowId

The type for application-specific windows.

source

type ContentId: ApplicationContentId

The type for application-specific content within a window.

Required Methods§

source

fn content_of_command(cmdtype: CommandType) -> Self::ContentId

Get the ApplicationContentId used to show a given command type.

Provided Methods§

source

fn complete( text: &EditRope, cursor: &mut Cursor, content: &Self::ContentId, store: &mut Store<Self> ) -> Vec<String>

Given a Cursor position in an EditRope, and its content identifier, generate a list of completion candidates.

By default, this returns an empty list, which causes completion inside buffers to fall back to word completion.

Object Safety§

This trait is not object safe.

Implementors§