[][src]Struct partial_io::PartialWrite

pub struct PartialWrite<W> { /* fields omitted */ }

A writer wrapper that breaks inner Write instances up according to the provided iterator.

Examples

use std::io::Write;

use partial_io::{PartialOp, PartialWrite};

let writer = Vec::new();
let iter = ::std::iter::repeat(PartialOp::Limited(1));
let mut partial_writer = PartialWrite::new(writer, iter);
let in_data = vec![1, 2, 3, 4];

let size = partial_writer.write(&in_data).unwrap();
assert_eq!(size, 1);
assert_eq!(&partial_writer.get_ref()[..], &[1]);

Implementations

impl<W> PartialWrite<W> where
    W: Write
[src]

pub fn new<I>(inner: W, iter: I) -> Self where
    I: IntoIterator<Item = PartialOp> + 'static,
    I::IntoIter: Send
[src]

Creates a new PartialWrite wrapper over the writer with the specified PartialOps.

pub fn set_ops<I>(&mut self, iter: I) -> &mut Self where
    I: IntoIterator<Item = PartialOp> + 'static,
    I::IntoIter: Send
[src]

Sets the PartialOps for this writer.

pub fn get_ref(&self) -> &W[src]

Acquires a reference to the underlying writer.

pub fn get_mut(&mut self) -> &mut W[src]

Acquires a mutable reference to the underlying writer.

pub fn into_inner(self) -> W[src]

Consumes this wrapper, returning the underlying writer.

Trait Implementations

impl<W> Debug for PartialWrite<W> where
    W: Debug
[src]

impl<W> Read for PartialWrite<W> where
    W: Read + Write
[src]

impl<W> Write for PartialWrite<W> where
    W: Write
[src]

Auto Trait Implementations

impl<W> !RefUnwindSafe for PartialWrite<W>[src]

impl<W> Send for PartialWrite<W> where
    W: Send
[src]

impl<W> !Sync for PartialWrite<W>[src]

impl<W> Unpin for PartialWrite<W> where
    W: Unpin
[src]

impl<W> !UnwindSafe for PartialWrite<W>[src]

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,