Struct pretty_print::PrettyProvider
source · pub struct PrettyProvider<'a> { /* private fields */ }Implementations§
source§impl<'a> PrettyProvider<'a>
impl<'a> PrettyProvider<'a>
source§impl<'a> PrettyProvider<'a>where
'a: 'static,
impl<'a> PrettyProvider<'a>where 'a: 'static,
pub fn nil(&'a self) -> PrettyTree<'a>
pub fn space(&'a self) -> PrettyTree<'a>
pub fn hardline(&'a self) -> PrettyTree<'a>
pub fn text<S>(&'a self, text: S) -> PrettyTree<'a>where S: Into<Cow<'static, str>>,
pub fn keyword<S>(&'a self, text: S) -> PrettyTree<'a>where S: Into<Cow<'static, str>>,
pub fn identifier<S>(&'a self, text: S) -> PrettyTree<'a>where S: Into<Cow<'static, str>>,
pub fn generic<S>(&'a self, text: S) -> PrettyTree<'a>where S: Into<Cow<'static, str>>,
pub fn argument<S>(&'a self, text: S) -> PrettyTree<'a>where S: Into<Cow<'static, str>>,
pub fn operator<S>(&'a self, text: S) -> PrettyTree<'a>where S: Into<Cow<'static, str>>,
pub fn string_style(&self) -> ColorSpec
pub fn number_style(&self) -> ColorSpec
pub fn macro_style(&self) -> ColorSpec
source§impl<'a> PrettyProvider<'a>
impl<'a> PrettyProvider<'a>
sourcepub fn concat<I>(&'a self, docs: I) -> PrettyTree<'a>where
I: IntoIterator,
I::Item: Pretty<'a, Arena<'a, ColorSpec>, ColorSpec>,
pub fn concat<I>(&'a self, docs: I) -> PrettyTree<'a>where I: IntoIterator, I::Item: Pretty<'a, Arena<'a, ColorSpec>, ColorSpec>,
Allocate a document concatenating the given documents.
sourcepub fn intersperse<T, S>(&'a self, terms: &[T], joint: S) -> PrettyTree<'a>where
T: PrettyPrint,
S: Pretty<'a, Arena<'a, ColorSpec>, ColorSpec> + Clone,
pub fn intersperse<T, S>(&'a self, terms: &[T], joint: S) -> PrettyTree<'a>where T: PrettyPrint, S: Pretty<'a, Arena<'a, ColorSpec>, ColorSpec> + Clone,
Allocate a document that intersperses the given separator S between the given documents
[A, B, C, ..., Z], yielding [A, S, B, S, C, S, ..., S, Z].
Compare the intersperse method from the itertools crate.
NOTE: The separator type, S may need to be cloned. Consider using cheaply cloneable ptr
like RefDoc or RcDoc
sourcepub fn join<T, S>(&'a self, terms: &[T], joint: &'static str) -> PrettyTree<'a>where
T: PrettyPrint,
S: Pretty<'a, Arena<'a, ColorSpec>, ColorSpec> + Clone,
pub fn join<T, S>(&'a self, terms: &[T], joint: &'static str) -> PrettyTree<'a>where T: PrettyPrint, S: Pretty<'a, Arena<'a, ColorSpec>, ColorSpec> + Clone,
Allocate a document that intersperses the given separator S between the given documents
[A, B, C, ..., Z], yielding [A, S, B, S, C, S, ..., S, Z].
Compare the intersperse method from the itertools crate.
NOTE: The separator type, S may need to be cloned. Consider using cheaply cloneable ptr
like RefDoc or RcDoc
Trait Implementations§
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for PrettyProvider<'a>
impl<'a> !Send for PrettyProvider<'a>
impl<'a> !Sync for PrettyProvider<'a>
impl<'a> Unpin for PrettyProvider<'a>
impl<'a> !UnwindSafe for PrettyProvider<'a>
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