[−][src]Struct glommio::io::ReadResult
ReadResult encapsulates a buffer, returned by read operations like get_buffer_aligned
and
read_dma
Implementations
impl ReadResult
[src]
pub fn read_at(&self, offset: usize, dst: &mut [u8]) -> usize
[src]
Copies the contents of this ReadResult
into the byte-slice dst
.
The copy starts at position offset
into the ReadResult
and copies
as many bytes as possible until either we don't have more bytes to copy
or dst
doesn't have more space to hold them.
pub fn slice(&self, extra_offset: usize, len: usize) -> Result<ReadResult>
[src]
Creates a slice of this ReadResult with the given offset and length.
Returns an std::io::Error
with [std::io::ErrorKind
] [InvalidInput
] if
either offset or offset + len would not fit in the original buffer.
pub fn len(&self) -> usize
[src]
The length of this buffer
pub fn as_bytes(&self) -> &[u8]
[src]
Allows accessing the contents of this buffer as a byte slice
Trait Implementations
impl Clone for ReadResult
[src]
fn clone(&self) -> ReadResult
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for ReadResult
[src]
Auto Trait Implementations
impl !RefUnwindSafe for ReadResult
impl !Send for ReadResult
impl !Sync for ReadResult
impl Unpin for ReadResult
impl UnwindSafe for ReadResult
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,