pub struct RichDocumentViewState { /* private fields */ }Expand description
Shareable retained state for a RichDocumentView.
The state owns document-spanning selection and expansion state separately from Markdown content, so structural streaming updates do not reset either.
Implementations§
Source§impl RichDocumentViewState
impl RichDocumentViewState
pub fn new() -> Self
pub fn selected_text(&self) -> Option<String>
pub fn clear_selection(&self) -> bool
pub fn is_expanded(&self, block: RichBlockId) -> bool
pub fn set_expanded(&self, block: RichBlockId, expanded: bool) -> bool
pub fn toggle_expanded(&self, block: RichBlockId) -> bool
Trait Implementations§
Source§impl Clone for RichDocumentViewState
impl Clone for RichDocumentViewState
Auto Trait Implementations§
impl !RefUnwindSafe for RichDocumentViewState
impl !Send for RichDocumentViewState
impl !Sync for RichDocumentViewState
impl !UnwindSafe for RichDocumentViewState
impl Forget for RichDocumentViewState
impl Freeze for RichDocumentViewState
impl Move for RichDocumentViewState
impl Unpin for RichDocumentViewState
impl UnsafeUnpin for RichDocumentViewState
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