Skip to main content

Concat

Struct Concat 

Source
pub struct Concat<O: TextOut>(/* private fields */);
Expand description

Concatenation: a Join with no separator, under the name the design brief and the language give it.

Every fragment is appended as it is. The item markers are accepted and counted all the same, so the interpreter’s concat and join share one shape and a program can move between them without the calls around them changing; that shared shape is the whole reason for a type where a bare output would do.

Implementations§

Source§

impl<O: TextOut> Concat<O>

Source

pub fn new(out: O) -> Self

Source

pub fn item_start(&mut self) -> Result<(), Fail>

Begin an item; see Join::item_start.

Source

pub fn item_end(&mut self) -> Result<(), Fail>

End the current item; see Join::item_end.

Source

pub fn items(&self) -> u64

Items begun so far.

Source

pub fn into_inner(self) -> O

Trait Implementations§

Source§

impl<O: TextOut> TextOut for Concat<O>

Source§

fn write_str(&mut self, s: &str) -> Result<(), Fail>

Source§

fn flush(&mut self) -> Result<(), Fail>

Source§

fn has_committed(&self) -> bool

Whether any text has reached the final destination, so that a failure found now leaves partial output behind. A renderer asks this when it fails and reports committed_output from the answer, which is how a host knows to print output: "partial" rather than "none". The default is the conservative answer for an output that cannot tell: whatever the renderer handed over may be out. render’s WriteOut answers exactly, from the bytes its writer received; a fragment that is still buffered is not committed, and into_inner drops it rather than sending it after the fact.

Auto Trait Implementations§

§

impl<O> Freeze for Concat<O>
where Join<O>: Freeze,

§

impl<O> RefUnwindSafe for Concat<O>
where Join<O>: RefUnwindSafe,

§

impl<O> Send for Concat<O>
where Join<O>: Send,

§

impl<O> Sync for Concat<O>
where Join<O>: Sync,

§

impl<O> Unpin for Concat<O>
where Join<O>: Unpin,

§

impl<O> UnsafeUnpin for Concat<O>
where Join<O>: UnsafeUnpin,

§

impl<O> UnwindSafe for Concat<O>
where Join<O>: UnwindSafe,

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

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 T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.