Struct laby::RenderIterator

source ·
pub struct RenderIterator<I>(pub I)
where
         I: IntoIterator,
         I::Item: Render;
Expand description

Wraps an Iterator, making it implement Render.

This is a workaround for Rust’s lack of impl specialization. When Rust gets specialization, this type may no longer be necessary.

All items yielded by the iterator must implement Render, which will be rendered sequentially, in the order they are yielded, without delimiters.

This renderer is lazy; the iterator wrapped by this type will only be iterated when render is called on the value, not when the value is constructed.

Consider using the iter! macro instead of constructing this type manually.

Tuple Fields§

§0: I

The iterator from which items are rendered.

Trait Implementations§

source§

impl<I> From<I> for RenderIterator<I>where I: IntoIterator, I::Item: Render,

source§

fn from(iter: I) -> Self

Converts to this type from the input type.
source§

impl<I> Render for RenderIterator<I>where I: IntoIterator, I::Item: Render,

source§

fn render(self, buf: &mut Buffer)

Formats this value into the given output buffer, consuming itself.

Auto Trait Implementations§

§

impl<I> RefUnwindSafe for RenderIterator<I>where I: RefUnwindSafe,

§

impl<I> Send for RenderIterator<I>where I: Send,

§

impl<I> Sync for RenderIterator<I>where I: Sync,

§

impl<I> Unpin for RenderIterator<I>where I: Unpin,

§

impl<I> UnwindSafe for RenderIterator<I>where I: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<!> for T

const: unstable · source§

fn from(t: !) -> T

Converts to this type from the input type.
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.