pub struct Para {
pub mark: Fmt,
pub align: u8,
pub list: u8,
pub level: u8,
pub style: u8,
/* private fields */
}Expand description
a paragraph: its text (no ‘\n’) with runs of formats, and its attributes. The attribute fields may be set directly while building a document (not undoable; RichDoc’s setters are).
Fields§
§mark: Fmtthe format of the paragraph’s end: typing into the empty paragraph takes it
align: u8RA_*
list: u8LS_*
level: u8indent / list level 0..LEVEL_MAX
style: u8PS_*
Implementations§
Source§impl Para
impl Para
Sourcepub fn push(&mut self, text: &str, fmt: &Fmt)
pub fn push(&mut self, text: &str, fmt: &Fmt)
append text in a format (‘\n’ and ‘\r’ are dropped)
Sourcepub fn spans(&self) -> impl Iterator<Item = (usize, usize, &Fmt)> + '_
pub fn spans(&self) -> impl Iterator<Item = (usize, usize, &Fmt)> + '_
the runs as (start, end, format)
Sourcepub fn fmt_at(&self, byte: usize) -> &Fmt
pub fn fmt_at(&self, byte: usize) -> &Fmt
the format of the character at byte (the last one at the end; the mark when empty)
Sourcepub fn typing_fmt(&self, byte: usize) -> Fmt
pub fn typing_fmt(&self, byte: usize) -> Fmt
the format typing at byte takes: the character before it (at the start: the first character; empty: the mark); a link ends at its end
Trait Implementations§
Auto Trait Implementations§
impl Forget for Para
impl Freeze for Para
impl RefUnwindSafe for Para
impl Send for Para
impl Sync for Para
impl Unpin for Para
impl UnsafeUnpin for Para
impl UnwindSafe for Para
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