pub struct EditController(/* private fields */);Implementations§
Source§impl EditController
impl EditController
pub fn new() -> Self
Sourcepub fn id(&self) -> u64
pub fn id(&self) -> u64
Unique id — how the engine finds the render-tree node that
declared this controller (same shape as FocusNode::id).
Sourcepub fn replace_range(&self, start: usize, end: usize, text: impl Into<String>)
pub fn replace_range(&self, start: usize, end: usize, text: impl Into<String>)
Replace an explicit [start, end) char range — independent of
wherever the caret currently is (the markdown-toolbar-Bold-button
primitive: replace_range(sel.0, sel.1, format!("**{}**", text))).
pub fn insert_at_cursor(&self, text: impl Into<String>)
pub fn set_selection(&self, sel: Selection)
pub fn select_all(&self)
pub fn undo(&self)
pub fn redo(&self)
Sourcepub fn value(&self) -> String
pub fn value(&self) -> String
The field’s value as of the last time the engine applied a drained op (a read-only snapshot — not live within the same frame an op was JUST enqueued; the engine hasn’t run yet).
pub fn selection(&self) -> Selection
Trait Implementations§
Source§impl Clone for EditController
impl Clone for EditController
Source§fn clone(&self) -> EditController
fn clone(&self) -> EditController
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EditController
impl Debug for EditController
Source§impl Default for EditController
impl Default for EditController
Auto Trait Implementations§
impl Freeze for EditController
impl RefUnwindSafe for EditController
impl Send for EditController
impl Sync for EditController
impl Unpin for EditController
impl UnsafeUnpin for EditController
impl UnwindSafe for EditController
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