#[non_exhaustive]pub enum Tool {
Show 16 variants
Bold,
Italic,
Underline,
Strike,
Code,
Link,
Heading1,
Heading2,
Heading3,
BulletList,
OrderedList,
Blockquote,
CodeBlock,
HorizontalRule,
Undo,
Redo,
}Expand description
One button of a rich text field’s toolbar. A tool is also a grant: the field keeps only the elements and attributes its tools produce, so a tool left off the toolbar cannot be typed, is dropped from a paste, and is removed from a forged post.
use tablo_core::{Field, Tool};
Field::rich_text(Post::fields().body()).toolbar(&[
&[Tool::Bold, Tool::Italic, Tool::Link],
&[Tool::BulletList, Tool::OrderedList],
]);Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Bold
<strong>.
Italic
<em>.
Underline
<u>.
Strike
<s>.
Code
Inline <code>.
Link
<a href> to an http, https or mailto URL, or a relative one.
Heading1
<h1>.
Heading2
<h2>.
Heading3
<h3>.
BulletList
<ul> of <li>.
OrderedList
<ol> of <li>, which may set start and type.
Blockquote
<blockquote>.
CodeBlock
<pre><code>. The editor records a block’s language as a class, which cleaning drops,
and the allowlist names elements, not where they nest, so a forged post keeps inline
<code> too.
HorizontalRule
<hr>.
Undo
Undoes the last change; produces nothing.
Redo
Redoes the last undone change; produces nothing.
Implementations§
Trait Implementations§
impl Copy for Tool
impl Eq for Tool
impl StructuralPartialEq for Tool
Auto Trait Implementations§
impl Freeze for Tool
impl RefUnwindSafe for Tool
impl Send for Tool
impl Sync for Tool
impl Unpin for Tool
impl UnsafeUnpin for Tool
impl UnwindSafe for Tool
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> CloneAny for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.