pub struct TextDocument { /* private fields */ }
Implementations§
Source§impl TextDocument
impl TextDocument
pub fn new() -> Self
pub fn block_list(&self) -> Vec<Weak<Block>>
pub fn root_frame(&self) -> Weak<Frame>
Sourcepub fn character_count(&self) -> usize
pub fn character_count(&self) -> usize
Character count, without counting new line character \n
pub fn find_block(&self, position: usize) -> Option<Weak<Block>>
pub fn first_block(&self) -> Weak<Block>
pub fn last_block(&self) -> Weak<Block>
pub fn block_count(&self) -> usize
pub fn create_cursor(&self) -> TextCursor
pub fn set_plain_text<S: Into<String>>( &mut self, plain_text: S, ) -> Result<(), ModelError>
pub fn to_plain_text(&self) -> String
Sourcepub fn clear(&mut self) -> Result<(), ModelError>
pub fn clear(&mut self) -> Result<(), ModelError>
Remove all elements and build a minimal set of element: a Frame, a Block and its empty Text
pub fn print_debug_elements(&self)
Sourcepub fn add_text_change_callback(&self, callback: fn(usize, usize, usize))
pub fn add_text_change_callback(&self, callback: fn(usize, usize, usize))
Signal the the text change at position, number of removed characters and number of added characters.
Sourcepub fn add_element_change_callback(&self, callback: fn(Element, ChangeReason))
pub fn add_element_change_callback(&self, callback: fn(Element, ChangeReason))
Signal the modified element with the reason. If two direct children elements changed at the same time.
Trait Implementations§
Source§impl Clone for TextDocument
impl Clone for TextDocument
Source§fn clone(&self) -> TextDocument
fn clone(&self) -> TextDocument
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Default for TextDocument
impl Default for TextDocument
Source§impl PartialEq for TextDocument
impl PartialEq for TextDocument
impl StructuralPartialEq for TextDocument
Auto Trait Implementations§
impl Freeze for TextDocument
impl !RefUnwindSafe for TextDocument
impl !Send for TextDocument
impl !Sync for TextDocument
impl Unpin for TextDocument
impl !UnwindSafe for TextDocument
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