pub struct MdState {
pub in_code_block: bool,
pub table_buf: Vec<String>,
pub code_buf: Vec<String>,
pub code_lang: Option<String>,
}Expand description
Parser state maintained across lines of a streamed response.
Fields§
§in_code_block: bool§table_buf: Vec<String>Accumulates consecutive |…| rows; flushed as an aligned block
when a non-table line arrives.
code_buf: Vec<String>Lines accumulated between an opening and closing code fence.
Flushed through highlight::highlight_block on close fence so
the syntax highlighter sees the whole block at once. Code thus
appears in one chunk at fence close rather than streaming
line-by-line.
code_lang: Option<String>Language tag captured from the opening fence ("rust" from
```rust). None for fences with no tag.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MdState
impl RefUnwindSafe for MdState
impl Send for MdState
impl Sync for MdState
impl Unpin for MdState
impl UnsafeUnpin for MdState
impl UnwindSafe for MdState
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> 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