pub enum Command {
Show 40 variants
Undo,
Redo,
ToggleBold,
ToggleItalic,
ToggleStrike,
ToggleCode,
SetBlock(BlockKind),
ToggleChecked,
SetCodeLanguage(Option<String>),
InsertRule,
InsertTable {
rows: usize,
columns: usize,
},
InsertRow {
below: bool,
},
InsertColumn {
right: bool,
},
DeleteRow,
DeleteColumn,
DeleteTable,
SetColumnAlign(ColumnAlign),
EditLink,
InsertText(String),
Indent,
Outdent,
SelectAll,
Copy,
Cut,
Paste,
InsertImage {
bytes: Vec<u8>,
name: Option<String>,
},
InsertImageFile(PathBuf),
InsertImageLink {
url: String,
alt: String,
},
ResolveImage {
id: ImageId,
url: String,
alt: String,
},
CancelImage {
id: ImageId,
},
RequestImage,
SetMode(Mode),
Focus,
Blur,
ZoomIn,
ZoomOut,
ResetZoom,
SetZoom(f32),
FitWidth,
FitPage,
}Expand description
Operations that can be triggered programmatically.
Variants§
Undo
Redo
ToggleBold
ToggleItalic
ToggleStrike
ToggleCode
SetBlock(BlockKind)
Changes the paragraph(s) under the selection: block type, list, task list or block quote. Applying the current kind again reverts.
ToggleChecked
Checks or unchecks the task list item(s) under the selection.
SetCodeLanguage(Option<String>)
Sets the language of the code block(s) under the selection.
InsertRule
InsertTable
Inserts an empty table; rows includes the header row.
InsertRow
Inserts a row above or below the row at the caret.
InsertColumn
Inserts a column left or right of the column at the caret.
DeleteRow
Deletes the table row at the caret.
DeleteColumn
Deletes the table column at the caret.
DeleteTable
Deletes the table at the caret.
SetColumnAlign(ColumnAlign)
Aligns the table column at the caret.
EditLink
Opens the link bar for the selection (or word under the caret).
InsertText(String)
Inserts text at the caret, replacing the selection.
Indent
Same as the Tab key.
Outdent
Same as Shift+Tab.
SelectAll
Copy
Cut
Paste
Pastes an image (with the images feature, desktop) or text.
InsertImage
Inserts an image from its encoded bytes, following the ImageSettings.
InsertImageFile(PathBuf)
Like Command::InsertImage with the content of a file (desktop).
InsertImageLink
Inserts  for an image that already has a URL.
ResolveImage
Answer to Event::ImagePasted: the placeholder becomes .
CancelImage
Answer to Event::ImagePasted: the placeholder is removed.
RequestImage
Emits Event::ImageRequested (the toolbar’s image button).
SetMode(Mode)
Focus
Blur
ZoomIn
ZoomOut
ResetZoom
SetZoom(f32)
Sets a zoom factor (1.0 = 100 %).
FitWidth
Zooms so the page width fits the widget.
FitPage
Zooms so a whole page fits the widget.
Trait Implementations§
impl StructuralPartialEq for Command
Auto Trait Implementations§
impl Forget for Command
impl Freeze for Command
impl RefUnwindSafe for Command
impl Send for Command
impl Sync for Command
impl Unpin for Command
impl UnsafeUnpin for Command
impl UnwindSafe for Command
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<State, Message> IntoBoot<State, Message> for State
impl<State, Message> IntoBoot<State, Message> for State
Source§fn into_boot(self) -> (State, Task<Message>)
fn into_boot(self) -> (State, Task<Message>)
Application.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more