Enum BlockKind
pub enum BlockKind {
Paragraph,
Quote,
Heading(u8),
Bullet {
indent: u8,
},
Numbered {
indent: u8,
},
Checklist {
indent: u8,
done: bool,
},
CodeBlock {
lang: Option<String>,
},
Table {
visual: bool,
},
Divider,
}Expand description
Each CodeBlock stores one authored source line. It may wrap visually;
Enter creates the next source row without changing existing line breaks.
Variants§
Paragraph
Quote
Markdown block quote, rendered with an accent rule and subdued surface.
Heading(u8)
Constructor helpers clamp to [1, 3]; other values are invalid.
Bullet
Numbered
The number is computed from position within its run at the same
indent (numbered_ordinals), not stored — renumbers automatically.
Checklist
CodeBlock
lang is the fence’s tag (e.g. rust), None for a bare fence.
Table
GitHub-flavoured Markdown table stored as editable source and rendered as a native grid.
Divider
Non-editable, non-focusable.
Implementations§
§impl BlockKind
impl BlockKind
pub fn text_role(&self) -> TextRole
pub fn text_role(&self) -> TextRole
The role a block’s line is set in, so a page’s body, headings and
code use the same ladder as every other surface: body Body, H1
LargeTitle, H2 Title, H3+ Heading, code and tables Code.
pub fn supports_indent(&self) -> bool
pub fn is_editable(&self) -> bool
pub fn indent(&self) -> u8
pub fn from_stored(stored: &str) -> Option<BlockKind>
pub fn from_stored(stored: &str) -> Option<BlockKind>
The kind a bound block list spells as stored (paragraph,
heading2, bullet:1, checklist:0:1, code:rust, …), when it is
a valid spelling: how an owner reads blocks it stored in that form.
pub fn stored(&self) -> String
pub fn stored(&self) -> String
This kind’s stored spelling, the inverse of Self::from_stored.
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§
§impl<T> AnyEq for T
impl<T> AnyEq for T
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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.§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.§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.§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.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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