#[repr(u8)]pub enum MarkdownSelector {
Heading {
level: HeadingLevel,
content: String,
},
Marker {
name: MarkerNameBuf,
blocks: Vec<MarkdownBlock>,
},
}Expand description
A selector naming one region of an existing Markdown document to manage.
Variants§
Heading
Selects the unique heading of a level and replaces its text.
Fields
§
level: HeadingLevelThe level of the one heading to match.
Marker
Selects a named marker region.
Implementations§
Source§impl MarkdownSelector
impl MarkdownSelector
Sourcefn validate(&self) -> Result<(), MarkdownError>
fn validate(&self) -> Result<(), MarkdownError>
Sourcefn check_shadowing(&self, others: &[Self]) -> Result<(), MarkdownError>
fn check_shadowing(&self, others: &[Self]) -> Result<(), MarkdownError>
Fail if this marker renders a heading that one of others selects.
Sourcepub(super) fn validate_all(selectors: &[Self]) -> Result<(), MarkdownError>
pub(super) fn validate_all(selectors: &[Self]) -> Result<(), MarkdownError>
Check the selectors without reading any source.
§Errors
Returns an error for invalid selectors and marker blocks that shadow a heading selector.
Sourcepub(super) fn reconcile_all(
source: &Source<'_>,
selectors: &[Self],
) -> Result<Vec<u8>, DocumentError>
pub(super) fn reconcile_all( source: &Source<'_>, selectors: &[Self], ) -> Result<Vec<u8>, DocumentError>
Reconcile selected Markdown regions while preserving all source
outside them. The output uses the line ending of source.
§Errors
Returns an error for malformed Markdown, invalid selectors, marker blocks that shadow a heading selector, or overlapping selections.
Trait Implementations§
Source§impl Clone for MarkdownSelector
impl Clone for MarkdownSelector
Source§fn clone(&self) -> MarkdownSelector
fn clone(&self) -> MarkdownSelector
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 MarkdownSelector
impl Debug for MarkdownSelector
impl Eq for MarkdownSelector
Source§impl<'ʄ> Facet<'ʄ> for MarkdownSelector
impl<'ʄ> Facet<'ʄ> for MarkdownSelector
Source§impl PartialEq for MarkdownSelector
impl PartialEq for MarkdownSelector
impl StructuralPartialEq for MarkdownSelector
Auto Trait Implementations§
impl Freeze for MarkdownSelector
impl RefUnwindSafe for MarkdownSelector
impl Send for MarkdownSelector
impl Sync for MarkdownSelector
impl Unpin for MarkdownSelector
impl UnsafeUnpin for MarkdownSelector
impl UnwindSafe for MarkdownSelector
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.