pub struct ExpandableState { /* private fields */ }Available on crate feature
markdown-preview only.Expand description
Expandable state for markdown content.
Tracks which content blocks are expanded/collapsed and their max line settings.
Implementations§
Source§impl ExpandableState
Constructor for ExpandableState.
impl ExpandableState
Constructor for ExpandableState.
Sourcepub fn new() -> ExpandableState
pub fn new() -> ExpandableState
Create a new expandable state with defaults.
Source§impl ExpandableState
Collapse expandable method for ExpandableState.
impl ExpandableState
Collapse expandable method for ExpandableState.
Source§impl ExpandableState
Expand expandable method for ExpandableState.
impl ExpandableState
Expand expandable method for ExpandableState.
Source§impl ExpandableState
Get max lines method for ExpandableState.
impl ExpandableState
Get max lines method for ExpandableState.
Source§impl ExpandableState
Is collapsed method for ExpandableState.
impl ExpandableState
Is collapsed method for ExpandableState.
Source§impl ExpandableState
Set default max lines method for ExpandableState.
impl ExpandableState
Set default max lines method for ExpandableState.
Sourcepub fn set_default_max_lines(&mut self, max_lines: usize)
pub fn set_default_max_lines(&mut self, max_lines: usize)
Set the default max lines for new expandable content.
§Arguments
max_lines- Default maximum visible lines when collapsed (minimum 1).
Source§impl ExpandableState
Set max lines method for ExpandableState.
impl ExpandableState
Set max lines method for ExpandableState.
Sourcepub fn set_max_lines(&mut self, content_id: &str, max_lines: usize)
pub fn set_max_lines(&mut self, content_id: &str, max_lines: usize)
Set max lines for expandable content.
§Arguments
content_id- The ID of the expandable content.max_lines- Maximum visible lines when collapsed (minimum 1).
Trait Implementations§
Source§impl Clone for ExpandableState
impl Clone for ExpandableState
Source§fn clone(&self) -> ExpandableState
fn clone(&self) -> ExpandableState
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 Debug for ExpandableState
impl Debug for ExpandableState
Source§impl Default for ExpandableState
Default trait implementation for ExpandableState.
impl Default for ExpandableState
Default trait implementation for ExpandableState.
Source§fn default() -> ExpandableState
fn default() -> ExpandableState
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ExpandableState
impl RefUnwindSafe for ExpandableState
impl Send for ExpandableState
impl Sync for ExpandableState
impl Unpin for ExpandableState
impl UnsafeUnpin for ExpandableState
impl UnwindSafe for ExpandableState
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more