pub struct EditorState(/* private fields */);Expand description
An editor state: the node map and the selection. A handle; cloning it
shares the same state. Once read-only (committed or parsed), nothing
changes it: an update works on a clone whose node map shares the nodes,
and a node is copied before its first change (getWritable).
Implementations§
Source§impl EditorState
impl EditorState
Sourcepub fn selection(&self) -> Option<SelectionRef>
pub fn selection(&self) -> Option<SelectionRef>
The state’s selection (editorState._selection).
Sourcepub fn clone_with_selection(
&self,
selection: Option<Option<SelectionRef>>,
) -> EditorState
pub fn clone_with_selection( &self, selection: Option<Option<SelectionRef>>, ) -> EditorState
clone(selection): a read-only state with the same nodes, and
selection (None is JS’s undefined, this state’s selection;
Some(None) is null). It is parsed when this one is, so
setEditorState(parsed.clone(null)) still runs transforms on it.
(Clone::clone shares this state itself.)
Sourcepub fn ptr_eq(&self, other: &EditorState) -> bool
pub fn ptr_eq(&self, other: &EditorState) -> bool
Whether self and other are the same state.
Trait Implementations§
Source§impl Clone for EditorState
impl Clone for EditorState
Source§impl Debug for EditorState
impl Debug for EditorState
Source§impl SignalValue for EditorState
impl SignalValue 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