[−][src]Struct frombytes::Bytes
A cursor over a slice of bytes.
Implementations
impl<'a> Bytes<'a>
[src]
pub const fn from_slice(bytes: &'a [u8]) -> Self
[src]
Returns a new cursor over a slice of bytes.
pub const fn into_inner(self) -> &'a [u8]
[src]
Consumes the Bytes
and returns the underlying data.
pub const fn position(&self) -> usize
[src]
Returns the current position of the Bytes
.
pub fn advance(&mut self, size: usize) -> Result<()>
[src]
Advances the position in the bytes.
pub fn align(&mut self, align: usize) -> Result<()>
[src]
Aligns the bytes to a particular word.
Panics
If the align size is a not one of the following powers of two: 1, 2, 4, 8, or 16.
pub fn read<T: FromBytes>(&mut self) -> Result<T, <T as FromBytes>::Error>
[src]
Trait Implementations
impl<'a> Clone for Bytes<'a>
[src]
impl<'a> Debug for Bytes<'a>
[src]
impl<'a> From<&'a [u8]> for Bytes<'a>
[src]
Auto Trait Implementations
impl<'a> RefUnwindSafe for Bytes<'a>
impl<'a> Send for Bytes<'a>
impl<'a> Sync for Bytes<'a>
impl<'a> Unpin for Bytes<'a>
impl<'a> UnwindSafe for Bytes<'a>
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,
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> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
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.
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>,