pub struct Text { /* private fields */ }Expand description
Represents the buffer of characters which are operated on by the commands, and the stack of operations that are eligible for undo commands.
Implementations§
Source§impl Text
use simple_text_editor::ops;
use simple_text_editor::text::Text;
let (num_ops, ops) = ops::parse(r#"4
1 hello
2 1
2 1
1 p me!
"#).unwrap();
let mut text = Text::new("", num_ops);
text.apply(ops);
assert_eq!(text.output(), "help me!".to_string());
impl Text
use simple_text_editor::ops;
use simple_text_editor::text::Text;
let (num_ops, ops) = ops::parse(r#"4
1 hello
2 1
2 1
1 p me!
"#).unwrap();
let mut text = Text::new("", num_ops);
text.apply(ops);
assert_eq!(text.output(), "help me!".to_string());Trait Implementations§
Auto Trait Implementations§
impl Freeze for Text
impl RefUnwindSafe for Text
impl Send for Text
impl Sync for Text
impl Unpin for Text
impl UnwindSafe for Text
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