pub struct PrettyProvider { /* private fields */ }Expand description
Represents a pretty-printable tree provider.
Implementations§
Source§impl PrettyProvider
impl PrettyProvider
Sourcepub fn text<'a, S, T>(&self, text: S) -> PrettyTree<'a, T>where
S: Into<T>,
pub fn text<'a, S, T>(&self, text: S) -> PrettyTree<'a, T>where
S: Into<T>,
Gets the width of the document.
Sourcepub fn custom<'a, S, T: Text<'a>>(
&self,
text: S,
style: Rc<AnsiStyle>,
) -> PrettyTree<'a, T>where
S: Into<T>,
pub fn custom<'a, S, T: Text<'a>>(
&self,
text: S,
style: Rc<AnsiStyle>,
) -> PrettyTree<'a, T>where
S: Into<T>,
Gets the width of the document.
Sourcepub fn keyword<'a, S, T: Text<'a>>(&self, text: S) -> PrettyTree<'a, T>where
S: Into<T>,
pub fn keyword<'a, S, T: Text<'a>>(&self, text: S) -> PrettyTree<'a, T>where
S: Into<T>,
Allocate a document containing the given text.
Sourcepub fn identifier<'a, S, T: Text<'a>>(&self, text: S) -> PrettyTree<'a, T>where
S: Into<T>,
pub fn identifier<'a, S, T: Text<'a>>(&self, text: S) -> PrettyTree<'a, T>where
S: Into<T>,
Allocate a document containing the given text.
Sourcepub fn generic<'a, S, T: Text<'a>>(&self, text: S) -> PrettyTree<'a, T>where
S: Into<T>,
pub fn generic<'a, S, T: Text<'a>>(&self, text: S) -> PrettyTree<'a, T>where
S: Into<T>,
Allocate a document containing the given text.
Sourcepub fn variable<'a, S, T: Text<'a>>(
&self,
text: S,
mutable: bool,
) -> PrettyTree<'a, T>where
S: Into<T>,
pub fn variable<'a, S, T: Text<'a>>(
&self,
text: S,
mutable: bool,
) -> PrettyTree<'a, T>where
S: Into<T>,
Allocate a document containing the given text.
Sourcepub fn argument<'a, S, T: Text<'a>>(
&self,
text: S,
mutable: bool,
) -> PrettyTree<'a, T>where
S: Into<T>,
pub fn argument<'a, S, T: Text<'a>>(
&self,
text: S,
mutable: bool,
) -> PrettyTree<'a, T>where
S: Into<T>,
Allocate a document containing the given text.
Sourcepub fn operator<'a, S, T: Text<'a>>(&self, text: S) -> PrettyTree<'a, T>where
S: Into<T>,
pub fn operator<'a, S, T: Text<'a>>(&self, text: S) -> PrettyTree<'a, T>where
S: Into<T>,
Allocate a document containing the given text.
Sourcepub fn string<'a, S, T: Text<'a>>(&self, text: S) -> PrettyTree<'a, T>where
S: Into<T>,
pub fn string<'a, S, T: Text<'a>>(&self, text: S) -> PrettyTree<'a, T>where
S: Into<T>,
Allocate a document containing the given text.
Sourcepub fn annotation<'a, S, T: Text<'a>>(&self, text: S) -> PrettyTree<'a, T>where
S: Into<T>,
pub fn annotation<'a, S, T: Text<'a>>(&self, text: S) -> PrettyTree<'a, T>where
S: Into<T>,
Allocate a document containing the given text.
Sourcepub fn number<'a, S, T: Text<'a>>(&self, text: S) -> PrettyTree<'a, T>where
S: Into<T>,
pub fn number<'a, S, T: Text<'a>>(&self, text: S) -> PrettyTree<'a, T>where
S: Into<T>,
Allocate a document containing the given text.
Sourcepub fn structure<'a, S, T: Text<'a>>(&self, text: S) -> PrettyTree<'a, T>where
S: Into<T>,
pub fn structure<'a, S, T: Text<'a>>(&self, text: S) -> PrettyTree<'a, T>where
S: Into<T>,
Allocate a document containing the given text.
Sourcepub fn variant<'a, S, T: Text<'a>>(&self, text: S) -> PrettyTree<'a, T>where
S: Into<T>,
pub fn variant<'a, S, T: Text<'a>>(&self, text: S) -> PrettyTree<'a, T>where
S: Into<T>,
Allocate a document containing the given text.
Sourcepub fn interface<'a, S, T: Text<'a>>(&self, text: S) -> PrettyTree<'a, T>where
S: Into<T>,
pub fn interface<'a, S, T: Text<'a>>(&self, text: S) -> PrettyTree<'a, T>where
S: Into<T>,
Allocate a document containing the given text.
Source§impl PrettyProvider
impl PrettyProvider
Sourcepub fn join<'a, I, T1, T2, T: Text<'a>>(
&self,
iter: I,
joint: T2,
) -> PrettyTree<'a, T>
pub fn join<'a, I, T1, T2, T: Text<'a>>( &self, iter: I, joint: T2, ) -> PrettyTree<'a, T>
Allocate a document containing the given text.
§Examples
let theme = PrettyProvider::new(80);
theme.join(vec!["a", "b", "c"], ", ");Sourcepub fn join_slice<'a, I, U, T: Text<'a>>(
&self,
iter: &[I],
joint: U,
) -> PrettyTree<'a, T>where
I: PrettyPrint<'a, T>,
U: PrettyPrint<'a, T>,
pub fn join_slice<'a, I, U, T: Text<'a>>(
&self,
iter: &[I],
joint: U,
) -> PrettyTree<'a, T>where
I: PrettyPrint<'a, T>,
U: PrettyPrint<'a, T>,
Allocate a document containing the given text.
§Examples
let theme = PrettyProvider::new(80);
theme.join(&["a", "b", "c"], ", ");Sourcepub fn concat<'a, I, U, T: Text<'a>>(&self, iter: I) -> PrettyTree<'a, T>where
I: IntoIterator<Item = U>,
U: PrettyPrint<'a, T>,
pub fn concat<'a, I, U, T: Text<'a>>(&self, iter: I) -> PrettyTree<'a, T>where
I: IntoIterator<Item = U>,
U: PrettyPrint<'a, T>,
Allocate a document containing the given text.
§Examples
let theme = PrettyProvider::new(80);
theme.concat(vec!["1", "2", "3"]);Sourcepub fn concat_slice<'a, U, T: Text<'a>>(&self, iter: &[U]) -> PrettyTree<'a, T>where
U: PrettyPrint<'a, T>,
pub fn concat_slice<'a, U, T: Text<'a>>(&self, iter: &[U]) -> PrettyTree<'a, T>where
U: PrettyPrint<'a, T>,
Allocate a document containing the given text.
§Examples
let theme = PrettyProvider::new(80);
theme.concat_slice(&["1", "2", "3"]);