Ignore all IO requests made on this object.
- For
Write
, that means reporting success always, but not doing anything.
- For
Read
and Seek
, that means acting like an immutable empty file.
This may confuse things which use Write
and Seek
together, as writing to an
Ignore
does not advance its seek position, which is not what would happen with a File
or
Cursor
or similar. The Seek
implementation ignores out of bound seeks, negative seeks,
etc., in the hope of maybe mitigating this a bit.
use std::io;
use iowrap::Ignore;
fn main() {
assert_eq!(0, io::copy(&mut Ignore::new(), &mut Ignore::new()).unwrap());
}
Performs copy-assignment from source
. Read more
Returns the "default value" for a type. Read more
Formats the value using the given formatter. Read more
Write a buffer into this writer, returning how many bytes were written. Read more
Flush this output stream, ensuring that all intermediately buffered contents reach their destination. Read more
Attempts to write an entire buffer into this writer. Read more
Writes a formatted string into this writer, returning any error encountered. Read more
Creates a "by reference" adaptor for this instance of Write
. Read more
Seek to an offset, in bytes, in a stream. Read more
Pull some bytes from this source into the specified buffer, returning how many bytes were read. Read more
Read the exact number of bytes required to fill buf
. Read more
🔬 This is a nightly-only experimental API. (read_initializer
)
Determines if this Read
er can work with buffers of uninitialized memory. Read more
Read all bytes until EOF in this source, placing them into buf
. Read more
Read all bytes until EOF in this source, appending them to buf
. Read more
Creates a "by reference" adaptor for this instance of Read
. Read more
Transforms this Read
instance to an [Iterator
] over its bytes. Read more
Creates an adaptor which will chain this stream with another. Read more
Creates an adaptor which will read at most limit
bytes from it. Read more
Returns the contents of the internal buffer, filling it with more data from the inner reader if it is empty. Read more
Tells this buffer that amt
bytes have been consumed from the buffer, so they should no longer be returned in calls to read
. Read more
Read all bytes into buf
until the delimiter byte
or EOF is reached. Read more
Read all bytes until a newline (the 0xA byte) is reached, and append them to the provided buffer. Read more
Returns an iterator over the contents of this reader split on the byte byte
. Read more
Returns an iterator over the lines of this reader. Read more
type Owned = T
Creates owned data from borrowed data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
type Error = !
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
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.
🔬 This is a nightly-only experimental API. (try_from
)
Mutably borrows from an owned value. Read more