Struct buf::Read
[−]
[src]
pub struct Read<T, R, A: Alloc> { /* fields omitted */ }
Methods
impl<T, R, A: Alloc + Default> Read<T, R, A>
[src]
pub fn with_capacity(r: R, cap: usize) -> Option<Self>
[src]
impl<T, R, A: Alloc> Read<T, R, A>
[src]
pub fn with_capacity_in(a: A, r: R, cap: usize) -> Option<Self>
[src]
pub fn from_raw(r: R, raw: RawVec<T, A>) -> Self
[src]
pub fn as_ref(&self) -> &R
[src]
pub fn as_mut(&mut self) -> &mut R
[src]
Trait Implementations
impl<T: Debug, R: Debug, A: Debug + Alloc> Debug for Read<T, R, A>
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl<T: PartialEq, R: PartialEq, A: PartialEq + Alloc> PartialEq for Read<T, R, A>
[src]
fn eq(&self, __arg_0: &Read<T, R, A>) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Read<T, R, A>) -> bool
[src]
This method tests for !=
.
impl<T: Eq, R: Eq, A: Eq + Alloc> Eq for Read<T, R, A>
[src]
impl<T: PartialOrd, R: PartialOrd, A: PartialOrd + Alloc> PartialOrd for Read<T, R, A>
[src]
fn partial_cmp(&self, __arg_0: &Read<T, R, A>) -> Option<Ordering>
[src]
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, __arg_0: &Read<T, R, A>) -> bool
[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, __arg_0: &Read<T, R, A>) -> bool
[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, __arg_0: &Read<T, R, A>) -> bool
[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, __arg_0: &Read<T, R, A>) -> bool
[src]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl<T: Ord, R: Ord, A: Ord + Alloc> Ord for Read<T, R, A>
[src]
fn cmp(&self, __arg_0: &Read<T, R, A>) -> Ordering
[src]
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.21.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
Compares and returns the minimum of two values. Read more
impl<T: Hash, R: Hash, A: Hash + Alloc> Hash for Read<T, R, A>
[src]
fn hash<__HTRA: Hasher>(&self, __arg_0: &mut __HTRA)
[src]
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl<T: Copy, R: Read<T>, A: Alloc> Read<T> for Read<T, R, A>
[src]
type Err = R::Err
fn read(&mut self, buf: &mut [T]) -> Result<usize, Self::Err>
[src]
r.read(buf) = self.readv(&mut [buf])
fn size_hint(&self) -> (usize, Option<usize>)
[src]
Return bounds on number of data ready to read. Read more
fn readv(&mut self, bufs: &mut [&mut [T]]) -> Result<usize, Self::Err>
[src]
Pull some data, at most bufs.fold(0, |n, buf| n+buf.len())
, from this source into given buffers; return how many data were actually read, or a failure. May block if no data can be read when called. Read more
fn read_full<E>(&mut self, buf: &mut [T]) -> Result<(), (E, usize)> where
E: From<Self::Err> + From<EndOfFile>,
[src]
E: From<Self::Err> + From<EndOfFile>,
Pull buf.len()
data from this source into given buffer; return ()
if so many data were actually read, or a failure and how many data were read before the failure.
fn data(self) -> Data<Self, T>
[src]
Make an Iterator
over the data of this reader.
fn read_onto_vec<A>(&mut self, xs: &mut Vec<T, A>) -> Result<usize, Self::Err> where
A: Alloc,
[src]
A: Alloc,
Pull data from this source into the spare storage of xs
, and modify its length to include the data read. If this fails, xs
is unmodified. Read more
fn split<P, E>(self, p: P, keep_delim: bool) -> Split<Self, T, P, E> where
E: From<Self::Err> + From<NoMemory>,
P: FnMut(T) -> bool,
[src]
E: From<Self::Err> + From<NoMemory>,
P: FnMut(T) -> bool,
impl<T: Copy, R: Write<T>, A: Alloc> Write<T> for Read<T, R, A>
[src]
Pass-thru
type Err = R::Err
fn write(&mut self, buf: &[T]) -> Result<usize, Self::Err>
[src]
w.write(buf) = self.writev(&[buf])
fn writev(&mut self, buf: &[&[T]]) -> Result<usize, Self::Err>
[src]
Push some data, at most bufs.fold(0, |n, buf| n+buf.len())
, to this sink from given buffers; return how many data were actually written, or a failure. May block if no data can be written when called. Read more
fn flush(&mut self) -> Result<(), Self::Err>
[src]
fn write_all(&mut self, buf: &[T]) -> Result<(), (Self::Err, usize)> where
Self::Err: From<EndOfFile>,
[src]
Self::Err: From<EndOfFile>,
Push buf.len()
data to this sink from given buffer; return ()
if so many data were actually written, or a failure and how many data were written before the failure.