pub struct EditorState {
pub document: Signal<Document>,
pub cursor: Signal<Option<(usize, usize)>>,
}Expand description
Headless editor state controller managing document AST and active selection cursor.
Fields§
§document: Signal<Document>§cursor: Signal<Option<(usize, usize)>>Implementations§
Source§impl EditorState
impl EditorState
Sourcepub fn to_markdown(&self) -> String
pub fn to_markdown(&self) -> String
Read the serialized markdown content of the editor.
Sourcepub fn load_markdown(&self, md: &str)
pub fn load_markdown(&self, md: &str)
Load document from a markdown string.
Sourcepub fn insert_text(&self, text: &str)
pub fn insert_text(&self, text: &str)
Appends text to the currently active block.
Sourcepub fn insert_block(&self, kind: BlockKind)
pub fn insert_block(&self, kind: BlockKind)
Inserts a new block below the current block.
Trait Implementations§
Source§impl Clone for EditorState
impl Clone for EditorState
Auto Trait Implementations§
impl !RefUnwindSafe for EditorState
impl !Send for EditorState
impl !Sync for EditorState
impl !UnwindSafe for EditorState
impl Forget for EditorState
impl Freeze for EditorState
impl Move for EditorState
impl Unpin for EditorState
impl UnsafeUnpin for EditorState
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