Struct minimad::Compound [−][src]
pub struct Compound<'s> { pub src: &'s str, pub bold: bool, pub italic: bool, pub code: bool, pub strikeout: bool, }
Expand description
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
src: &'s str
bold: bool
italic: bool
code: bool
strikeout: bool
Implementations
impl<'s> Compound<'s>
[src]
impl<'s> Compound<'s>
[src]pub fn sub(&self, r_start: usize, r_end: usize) -> 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 styling r_start is relative, that is 0 is the index of the first byte of this compound.
pub fn sub_chars(&self, r_start: usize, r_end: usize) -> Compound<'s>
[src]
pub fn sub_chars(&self, r_start: usize, r_end: usize) -> Compound<'s>
[src]return a sub part of the compound, with the same styling r_start is relative, that is 0 is the index of the first char of this compound.
The difference with sub
is that this method is unicode
aware and counts the chars instead of asking for the bytes
pub fn tail(&self, r_start: usize) -> Compound<'s>
[src]
pub fn tail(&self, r_start: usize) -> Compound<'s>
[src]return a sub part at end of the compound, with the same styling r_start is relative, that is if you give 0 you get a clone of this compound
pub fn tail_chars(&self, r_start: usize) -> Compound<'s>
[src]
pub fn tail_chars(&self, r_start: usize) -> Compound<'s>
[src]return a sub part at end of the compound, with the same styling r_start is relative, that is if you give 0 you get a clone of this compound
The difference with tail
is that this method is unicode
aware and counts the chars instead of asking for the bytes
pub fn cut_tail(&mut self, tail_size: usize) -> Compound<'s>
[src]
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,
strikeout: bool
) -> Compound<'s>
[src]
src: &'s str,
start: usize,
end: usize,
bold: bool,
italic: bool,
code: bool,
strikeout: bool
) -> Compound<'s>
pub fn bold(self) -> Compound<'s>
[src]
pub fn italic(self) -> Compound<'s>
[src]
pub fn code(self) -> Compound<'s>
[src]
pub fn strikeout(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 set_strikeout(&mut self, strikeout: bool)
[src]
pub fn as_str(&self) -> &'s str
[src]
pub fn char_length(&self) -> usize
[src]
pub fn is_empty(&self) -> bool
[src]
Trait Implementations
impl<'s> Eq for Compound<'s>
[src]
impl<'s> StructuralEq for Compound<'s>
[src]
impl<'s> StructuralPartialEq for Compound<'s>
[src]
Auto Trait Implementations
impl<'s> RefUnwindSafe for Compound<'s>
impl<'s> Send for Compound<'s>
impl<'s> Sync for Compound<'s>
impl<'s> Unpin for Compound<'s>
impl<'s> UnwindSafe for Compound<'s>
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more