[][src]Struct minimad::Compound

pub struct Compound<'s> {
    pub bold: bool,
    pub italic: bool,
    pub code: bool,
    // some fields omitted
}

a Compound is a part of a line with a consistent styling. It can be part of word, several words, some inline code, or even the whole line.

Fields

bold: boolitalic: boolcode: bool

Methods

impl<'s> Compound<'s>[src]

pub fn raw_str(src: &'s str) -> Compound<'s>[src]

pub fn sub(&self, r_start: usize, r_end: usize) -> Compound<'s>[src]

return a sub part of the compound, with the same syling r_start is relative, that is 0 is the index of the first char of this compound.

pub fn tail(&self, r_start: usize) -> Compound<'s>[src]

return a sub part at end of the compound, with the same syling r_start is relative, that is if you give 0 you get a clone of this compound

pub fn raw_part(src: &'s str, start: usize, end: usize) -> Compound<'s>[src]

pub fn new(
    src: &'s str,
    start: usize,
    end: usize,
    bold: bool,
    italic: bool,
    code: bool
) -> Compound<'s>
[src]

pub fn bold(self) -> Compound<'s>[src]

pub fn italic(self) -> Compound<'s>[src]

pub fn code(self) -> Compound<'s>[src]

pub fn set_bold(&mut self, bold: bool)[src]

pub fn set_italic(&mut self, italic: bool)[src]

pub fn set_code(&mut self, code: bool)[src]

pub fn as_str(&self) -> &'s str[src]

Trait Implementations

impl<'_> PartialEq<Compound<'_>> for Compound<'_>[src]

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<'s> Clone for Compound<'s>[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<'_> Eq for Compound<'_>[src]

impl<'_> Debug for Compound<'_>[src]

impl<'_> Display for Compound<'_>[src]

Auto Trait Implementations

impl<'s> Send for Compound<'s>

impl<'s> Sync for Compound<'s>

Blanket Implementations

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]