Struct text_document::text_document::TextDocument
source · [−]pub struct TextDocument { /* private fields */ }
Implementations
sourceimpl 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
sourceimpl Clone for TextDocument
impl Clone for TextDocument
sourcefn clone(&self) -> TextDocument
fn clone(&self) -> TextDocument
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Default for TextDocument
impl Default for TextDocument
sourceimpl PartialEq<TextDocument> for TextDocument
impl PartialEq<TextDocument> for TextDocument
sourcefn eq(&self, other: &TextDocument) -> bool
fn eq(&self, other: &TextDocument) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &TextDocument) -> bool
fn ne(&self, other: &TextDocument) -> bool
This method tests for !=
.
impl StructuralPartialEq for TextDocument
Auto Trait Implementations
impl !RefUnwindSafe for TextDocument
impl !Send for TextDocument
impl !Sync for TextDocument
impl Unpin for TextDocument
impl !UnwindSafe for TextDocument
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more