pub enum BlockKind {
Paragraph(Text),
Heading {
level: u8,
text: Text,
},
Bullet(Text),
Ordered {
number: u64,
text: Text,
},
Task {
checked: bool,
text: Text,
},
Quote {
kind: Option<QuoteKind>,
text: Text,
},
Code {
language: Option<String>,
code: Text,
},
Image {
url: String,
alt: Text,
width: Option<u32>,
},
Bookmark {
url: String,
form: Form,
},
Table {
align: Vec<Align>,
header: Vec<Text>,
rows: Vec<Vec<Text>>,
},
Rule,
}Expand description
The block vocabulary. Closed by design — a consumer that needs a block of its own is a reason to widen this enum rather than to grow an extension system.
Variants§
Paragraph(Text)
Heading
Bullet(Text)
Ordered
Fields
Task
Quote
A blockquote. kind is the GFM alert it opens with — see QuoteKind.
Code
The code carries a Text like every other editable region, so one
accessor and one edit path cover the whole document. Its marks are
unreachable rather than forbidden: nothing that writes here creates one.
Image
The caption is the alt text — markdown has one slot, and a reader that
cannot see the picture reads the same words. Like BlockKind::Code’s,
its marks are unreachable rather than forbidden.
Fields
Bookmark
A link with a block to itself, painted richly. Atomic on purpose:
everything it shows past the URL comes from crate::preview, so there
is nothing here for a caret to edit.
Form picks which of the three — a chip, a card, or a card with its
picture across the width. Off a line of its own the same link is a
Mark::Mention, which is the same three minus what shaped text cannot
hold.
Table
Rule
Trait Implementations§
impl Eq for BlockKind
impl StructuralPartialEq for BlockKind
Auto Trait Implementations§
impl Freeze for BlockKind
impl RefUnwindSafe for BlockKind
impl Send for BlockKind
impl Sync for BlockKind
impl Unpin for BlockKind
impl UnsafeUnpin for BlockKind
impl UnwindSafe for BlockKind
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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
key and return true if they are equal.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<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