Struct maud::Utf8Writer [] [src]

pub struct Utf8Writer<W: Write> {
    // some fields omitted
}

Wraps a std::io::Write in a std::fmt::Write.

Most I/O libraries work with binary data ([u8]), but Maud outputs Unicode strings (str). This adapter links them together by encoding the output as UTF-8.

Example

use std::io;
let mut writer = Utf8Writer::new(io::stdout());
let _ = html!(writer, p { "Hello, " $name "!" });
let result = writer.into_result();
result.unwrap();

Methods

impl<W: Write> Utf8Writer<W>
[src]

Creates a Utf8Writer from a std::io::Write.

Extracts the inner writer, along with any errors encountered along the way.

Drops the inner writer, returning any errors encountered along the way.

Trait Implementations

impl<W: Write> Write for Utf8Writer<W>
[src]

Writes a slice of bytes into this writer, returning whether the write succeeded. Read more

Glue for usage of the write! macro with implementors of this trait. Read more

Writes a char into this writer, returning whether the write succeeded. Read more