doc.rust-lang.org
pub trait Read
The Read trait allows for reading bytes from a source.
trait
alloc
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
fn by_ref(&mut self) -> &mut Self
Creates a "by reference" adapter for this instance of Read.
method
alloc
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
fn bytes(self) -> Bytes<Self>
Transforms this Read instance to an Iterator over its bytes.
method
alloc
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
fn chain<R>(self, next: R) -> Chain<Self, R>
Creates an adapter which will chain this stream with another.
method
alloc
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
fn read(&mut self, buf: &mut [u8]) -> Result<usize>
Pull some bytes from this source into the specified buffer, returning how many bytes were read.
method
alloc
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
fn read_exact(&mut self, buf: &mut [u8]) -> Result<()>
Reads the exact number of bytes required to fill buf.
method
alloc
Stable since 1.6.0
Version 1.100.0-nightly
doc.rust-lang.org
fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize>
Reads all bytes until EOF in this source, placing them into buf.
method
alloc
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
fn read_to_string(&mut self, buf: &mut String) -> Result<usize>
Reads all bytes until EOF in this source, appending them to buf.
method
alloc
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize>
Like read, except that it reads into a slice of buffers.
method
alloc
Stable since 1.36.0
Version 1.100.0-nightly
doc.rust-lang.org
fn take(self, limit: u64) -> Take<Self>
Creates an adapter which will read at most limit bytes from it.
method
alloc
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn read_to_string<R>(reader: R) -> crate::io::Result<crate::string::String>
Reads all bytes from a reader into a new String.
function
alloc
Stable since 1.65.0
Version 1.100.0-nightly
doc.rust-lang.org
pub struct Bytes<R>
An iterator over u8 values of a reader.
struct
alloc
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub struct Lines<B>
An iterator over the lines of an instance of BufRead.
struct
alloc
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub struct Split<B>
An iterator over the contents of an instance of BufRead split on a particular byte.
struct
alloc
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub mod rc
Single-threaded reference-counting pointers. 'Rc' stands for 'Reference Counted'.
module
alloc
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub struct Rc<T, A>
A single-threaded reference-counting pointer. 'Rc' stands for 'Reference Counted'.
struct
alloc
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn as_ptr(this: &Self) -> *const T
Provides a raw pointer to the data.
associated_function
alloc
Stable since 1.45.0
Version 1.100.0-nightly
doc.rust-lang.org
pub unsafe fn assume_init(self) -> Rc<T, A>
Converts to Rc<T>.
method
alloc
Stable since 1.82.0
Version 1.100.0-nightly
doc.rust-lang.org
pub unsafe fn decrement_strong_count(ptr: *const T)
Decrements the strong reference count on the Rc<T> associated with the provided pointer by one.
associated_function
alloc
Stable since 1.53.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn downcast<T>(self) -> Result<Rc<T, A>, Self>
Attempts to downcast the Rc<dyn Any> to a concrete type.
method
alloc
Stable since 1.29.0
Version 1.100.0-nightly