pub struct RichDocumentModel { /* private fields */ }Implementations§
Source§impl RichDocumentModel
impl RichDocumentModel
pub fn new() -> Self
pub fn from_markdown(markdown: impl Into<String>) -> Self
pub fn revision(&self) -> u64
pub fn markdown(&self) -> String
pub fn blocks(&self) -> Vec<RichDocumentBlock>
pub fn snapshot(&self) -> RichDocumentSnapshot
pub fn last_update(&self) -> RichDocumentUpdate
pub fn set_markdown(&self, markdown: impl Into<String>) -> bool
Sourcepub fn append_markdown(&self, fragment: &str) -> bool
pub fn append_markdown(&self, fragment: &str) -> bool
Append a streaming Markdown fragment and reparse only the mutable tail.
All blocks before the final Markdown block are retained byte-for-byte, including their stable IDs and any widget-local state keyed by them.
pub fn append_attachment(&self, attachment: RichAttachment) -> RichBlockId
pub fn append_extension(&self, extension: RichExtensionBlock) -> RichBlockId
pub fn update_structured( &self, id: RichBlockId, kind: RichDocumentBlockKind, ) -> bool
Trait Implementations§
Source§impl Clone for RichDocumentModel
impl Clone for RichDocumentModel
Source§impl Default for RichDocumentModel
impl Default for RichDocumentModel
Source§impl Observable<u64> for RichDocumentModel
impl Observable<u64> for RichDocumentModel
fn source_id(&self) -> SourceId
fn source_name(&self) -> Arc<str> ⓘ
fn get(&self) -> u64
fn subscribe(&self, observer: Observer) -> Subscription
Source§fn read(&self, reader: &mut dyn FnMut(&T))
fn read(&self, reader: &mut dyn FnMut(&T))
Call
reader once with a borrow of the current value. Read moreAuto Trait Implementations§
impl Forget for RichDocumentModel
impl Freeze for RichDocumentModel
impl Move for RichDocumentModel
impl RefUnwindSafe for RichDocumentModel
impl Send for RichDocumentModel
impl Sync for RichDocumentModel
impl Unpin for RichDocumentModel
impl UnsafeUnpin for RichDocumentModel
impl UnwindSafe for RichDocumentModel
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