Skip to main content

BaseKeymap

Struct BaseKeymap 

Source
pub struct BaseKeymap;
Expand description

Arrow keys, Home and End, Backspace and Delete with their word and line variants, Enter, Select All, and Escape, bound the way each platform binds them. It has the lowest priority, so extensions override any key.

Trait Implementations§

Source§

impl Clone for BaseKeymap

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for BaseKeymap

Source§

impl Debug for BaseKeymap

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for BaseKeymap

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Extension for BaseKeymap

Source§

fn name(&self) -> &'static str

A unique name, used in errors and for debugging.
Source§

fn priority(&self) -> i32

Ordering: higher runs first. The default is 100, as in TipTap.
Source§

fn keymap( &self, _schema: &Schema, platform: Platform, ) -> Result<Vec<Binding>, EditorError>

Key bindings, in ProseMirror notation such as Mod-b.
Source§

fn schema(&self, schema: SchemaBuilder) -> SchemaBuilder

Register blocks, marks, and embeds.
Source§

fn commands(&self, _schema: &Schema) -> Result<Vec<CommandSpec>, EditorError>

Named commands with typed arguments. They are what dynamic hosts run with Editor::run_named, and their metadata is what bindings generate typed APIs from.
Source§

fn queries(&self, _schema: &Schema) -> Result<Vec<QuerySpec>, EditorError>

Named questions about the state, such as whether a mark is active or a block’s attribute value.
Source§

fn nodes(&self) -> Vec<NodeMeta>

The blocks, marks, and embeds Extension::schema registers, with typed attributes, for generated bindings.
Source§

fn input_rules(&self, _schema: &Schema) -> Result<Vec<InputRule>, EditorError>

Rules that rewrite text as it is typed.
Source§

fn paste_rules(&self, _schema: &Schema) -> Result<Vec<PasteRule>, EditorError>

Rules that format pasted text.
Source§

fn code_blocks(&self, _schema: &Schema) -> Result<Vec<BlockTypeId>, EditorError>

Text block types that hold code: input and paste rules never run inside them and pasted text keeps its line breaks.
Source§

fn after_update( &self, _state: &mut EditorState, _update: &Update, ) -> CommandResult

Fix up the state after a local update, e.g. keep a trailing paragraph. The result is folded into the same update and undo step.
Source§

fn update_filters( &self, _schema: &Schema, ) -> Result<Vec<UpdateFilter>, EditorError>

Checks a local update, fix-ups included, must pass to stand. One that returns false undoes the update, and the command reports that it did not apply, as TipTap’s filterTransaction does; a character limit uses one to refuse text past the limit. They are collected when the editor is built, so an editor whose extensions have none pays nothing per update.
Source§

fn adornments(&self, _state: &EditorState) -> Vec<Adornment>

Text to show in the document without it being part of it, for state: see Adornment. Hosts ask after every update, through Editor::adornments, and lay the text out where it goes.
Source§

fn adorns(&self) -> bool

Whether Extension::adornments can return any, so editors whose extensions never adorn skip asking after every update.
Source§

impl TypedExtension for BaseKeymap

The standard keys add no commands of their own, so their handle is just the proof of registration.

Source§

type Handle = Registration

The handle EditorBuilder::add returns: methods for this extension’s commands, queries, and attributes.
Source§

fn handle(&self, registration: Registration) -> Registration

The handle, given proof of registration.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.