[−][src]Struct connect6::game::Paint
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
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
T: From<U>,
[src]
T: From<U>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
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.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,