Function ferris_says::say
[−]
[src]
pub fn say<W>(input: &[u8], width: usize, writer: &mut W) -> Result<()> where
W: Write,
Have Ferris print out her saying something.
input
is a slice of bytes that you want to be written out to somewhere
width
is how wide you want the box that Ferris says something into to be
writer
is anywhere that can be written to using the Writer trait like
STDOUT or STDERR
Example
The following bit of code will write the byte string to STDOUT
use ferris_says::*; use std::io::{ stdout, BufWriter }; let stdout = stdout(); let out = b"Hello fellow Rustaceans!"; let width = 24; let mut writer = BufWriter::new(stdout.lock()); say(out, width, &mut writer).unwrap();
This will print out:
----------------------------
| Hello fellow Rustaceans! |
----------------------------
\
\
_~^~^~_
\) / o o \ (/
'_ - _'
/ '-----' \