[][src]Struct connect6::game::Paint

pub struct Paint<'a> { /* fields omitted */ }

Simple ascii buffer

Examples

 let mut stdout = std::io::stdout();
 let mut paint = Paint::new(&mut stdout);
 paint.push(b"ABC");
 paint.push_one('\n' as u8);
 paint.write();

Expected results

This example is not tested
ABC

Methods

impl<'a> Paint<'a>[src]

pub fn new(writer: &'a mut dyn Write) -> Paint<'a>[src]

Construct a new Paint.

Examples

let mut stdout = std::io::stdout();
let mut paint = Paint::new(&mut stdout);

pub fn push(&mut self, data: &[u8])[src]

Push a byte slice to the buffer

Examples

let mut stdout = std::io::stdout();
let mut paint = Paint::new(&mut stdout);
paint.push(b"ABC");

pub fn push_one(&mut self, data: u8)[src]

Push a single u8 to the buffer

Examples

let mut stdout = std::io::stdout();
let mut paint = Paint::new(&mut stdout);
paint.push_one('\n' as u8);

pub fn write(&mut self) -> Result<usize>[src]

Write buffer to the io stream

Examples

let mut stdout = std::io::stdout();
let mut paint = Paint::new(&mut stdout);
paint.push(b"ABC");
paint.push_one('\n' as u8);
paint.write();

Expected results

This example is not tested
ABC

Auto Trait Implementations

impl<'a> !Send for Paint<'a>

impl<'a> !Sync for Paint<'a>

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Erased for T