Enum genco::Element
[−]
[src]
pub enum Element<'el, C: 'el> { Rc(Rc<Element<'el, C>>), Borrowed(&'el Element<'el, C>), Append(Con<'el, Tokens<'el, C>>), Push(Con<'el, Tokens<'el, C>>), Nested(Con<'el, Tokens<'el, C>>), Literal(Cons<'el>), Quoted(Cons<'el>), Custom(Con<'el, C>), PushSpacing, Line, Spacing, LineSpacing, }
A single element in a set of tokens.
Variants
Rc(Rc<Element<'el, C>>)
A refcounted member.
Borrowed(&'el Element<'el, C>)
A borrowed element.
Append(Con<'el, Tokens<'el, C>>)
Append the given set of tokens.
Push(Con<'el, Tokens<'el, C>>)
Append the given set of tokens in a PushSpacing way.
Nested(Con<'el, Tokens<'el, C>>)
Append the given set of tokens in a nested way.
Literal(Cons<'el>)
A borrowed string.
Quoted(Cons<'el>)
A borrowed quoted string.
Custom(Con<'el, C>)
Language-specific items.
PushSpacing
Push an empty line.
Line
Unconditionally push a line.
Spacing
Single-space spacing.
LineSpacing
New line if needed.
Methods
impl<'el, C: Custom> Element<'el, C>
[src]
fn format(
&self,
out: &mut Formatter,
extra: &mut C::Extra,
level: usize
) -> Result
[src]
&self,
out: &mut Formatter,
extra: &mut C::Extra,
level: usize
) -> Result
Format the given element.
Trait Implementations
impl<'el, C: Debug + 'el> Debug for Element<'el, C>
[src]
impl<'el, C: Clone + 'el> Clone for Element<'el, C>
[src]
fn clone(&self) -> Element<'el, C>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<'el, C: PartialEq + 'el> PartialEq for Element<'el, C>
[src]
fn eq(&self, __arg_0: &Element<'el, C>) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Element<'el, C>) -> bool
[src]
This method tests for !=
.
impl<'el, C: Eq + 'el> Eq for Element<'el, C>
[src]
impl<'el, C: Custom> From<C> for Element<'el, C>
[src]
impl<'el, C: Custom> From<&'el C> for Element<'el, C>
[src]
impl<'el, C> From<String> for Element<'el, C>
[src]
impl<'el, C> From<&'el str> for Element<'el, C>
[src]
impl<'el, C> From<Rc<String>> for Element<'el, C>
[src]
impl<'el, C> From<Cons<'el>> for Element<'el, C>
[src]
impl<'el, C> From<&'el Element<'el, C>> for Element<'el, C>
[src]
impl<'el, C> From<Rc<Element<'el, C>>> for Element<'el, C>
[src]
impl<'el, C> From<Tokens<'el, C>> for Element<'el, C>
[src]
impl<'el, C> From<&'el Tokens<'el, C>> for Element<'el, C>
[src]
impl<'el, C> From<Rc<Tokens<'el, C>>> for Element<'el, C>
[src]
impl<'el, C> IntoTokens<'el, C> for Element<'el, C>
[src]
Convert element to tokens.
fn into_tokens(self) -> Tokens<'el, C>
[src]
Convert the type into tokens.