Struct rainbowcoat::Colors
[−]
[src]
pub struct Colors<W> { /* fields omitted */ }
Colors writable type characters with the ascii rainbow
You can use this any type that requires a io::Write
type
examples
Write direcly to stdout
use std::io::{self, Write}; write!( &mut rainbowcoat::Colors::new(io::stdout()), "hello rainbow" );
A convenience function makes this common case even easier
use std::io::Write; write!( &mut rainbowcoat::stdout(), "hello rainbow" );
Methods
impl<W> Colors<W>
[src]
fn new(wrapped: W) -> Self
Creates a new Colors
instance with default spread of 3.0
,
frequency of 0.1
and seed valud of 0.0
fn configure(wrapped: W, spread: f64, frequency: f64, seed: f64) -> Self
Creates a more configurable instance with provided params
Trait Implementations
impl<W: Write> Write for Colors<W>
[src]
fn write(&mut self, buf: &[u8]) -> Result<usize>
Write a buffer into this object, returning how many bytes were written. Read more
fn flush(&mut self) -> Result<()>
Flush this output stream, ensuring that all intermediately buffered contents reach their destination. Read more
fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
1.0.0
Attempts to write an entire buffer into this write. Read more
fn write_fmt(&mut self, fmt: Arguments) -> Result<(), Error>
1.0.0
Writes a formatted string into this writer, returning any error encountered. Read more
fn by_ref(&mut self) -> &mut Self
1.0.0
Creates a "by reference" adaptor for this instance of Write
. Read more