Function ferris_says::say

source ·
pub fn say<W>(input: &str, max_width: usize, writer: W) -> Result<()>where
    W: Write,
Expand description

Print out Ferris saying something.

input is a string slice that you want to be written out to somewhere

max_width is the maximum width of a line of text before it is wrapped

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 = "Hello fellow Rustaceans!";
let width = 24;

let writer = BufWriter::new(stdout.lock());
say(out, width, writer).unwrap();

This will print out:

 __________________________
< Hello fellow Rustaceans! >
 --------------------------
        \
         \
            _~^~^~_
        \) /  o o  \ (/
          '_   -   _'
          / '-----' \