[][src]Trait ikon::encode::Write

pub trait Write: Encode {
    fn write<W: Write>(&mut self, w: &mut W) -> Result<()>;
}

The Write trait provides functionality for writing the contents of an Encode into a io::Write implementor.

Usefull for icon formats such as .ico and .icns files.

Required methods

fn write<W: Write>(&mut self, w: &mut W) -> Result<()>

Writes the contents of the icon to w.

Example

fn main() -> io::Result<()> {
    let icon = Icon::new();

    /* Process the icon */

    let file = File::create("out.icns")?;
    icon.write(file)
}
Loading content...

Implementors

Loading content...