[−][src]Struct jens::Block
A Block
is one or many lines of text. More blocks can be embedded within a
line, in which case the indentation of the previous line will be preserved when
outputting new lines.
Methods
impl Block
[src]
pub fn empty() -> Self
[src]
pub fn write_to(&self, f: &mut Formatter, prefix: &str) -> Result
[src]
pub fn set<T: Into<Block>>(self, placeholder_name: &str, content: T) -> Self
[src]
pub fn join_map<T, U, F>(iter: T, mapper: F) -> Self where
T: IntoIterator<Item = U>,
F: Fn(U, IteratorLocation) -> Block,
[src]
T: IntoIterator<Item = U>,
F: Fn(U, IteratorLocation) -> Block,
Run a function that maps over each item in an iterator, then join the results.
Provides an IteratorLocation
for checking whether the current item is the
first/last/only/nth item in the list.
pub fn for_each<T, U, F>(self, iter: T, mapper: F) -> Self where
T: IntoIterator<Item = U>,
F: Fn(U, Block) -> Block,
[src]
T: IntoIterator<Item = U>,
F: Fn(U, Block) -> Block,
Deprecated
Repeat a template for each element of some iterable value.
Deprecated in favor of join_map
.
pub fn join<T>(blocks: T) -> Block where
T: IntoIterator<Item = Block>,
[src]
T: IntoIterator<Item = Block>,
Join multiple blocks into a single block
Trait Implementations
impl<'_> From<&'_ Block> for String
[src]
impl<T: Into<String>> From<T> for Block
[src]
impl Clone for Block
[src]
fn clone(&self) -> Block
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl PartialEq<Block> for Block
[src]
impl Debug for Block
[src]
impl Display for Block
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,