pub unsafe trait Pod {
// Required methods
fn as_bytes(&self) -> &[u8] ⓘ;
fn as_bytes_mut(&mut self) -> &mut [u8] ⓘ;
// Provided methods
fn from_bytes(bytes: &[u8]) -> Result<&Self>
where Self: Sized { ... }
unsafe fn from_bytes_unchecked(bytes: &[u8]) -> &Self
where Self: Sized { ... }
fn from_bytes_mut(bytes: &mut [u8]) -> Result<&mut Self>
where Self: Sized { ... }
unsafe fn from_bytes_mut_unchecked(bytes: &mut [u8]) -> &mut Self
where Self: Sized { ... }
}
Expand description
§Safety
Implementors must ensure that the type is nothing more than a sequence of bytes
Required Methods§
Provided Methods§
Sourceunsafe fn from_bytes_unchecked(bytes: &[u8]) -> &Selfwhere
Self: Sized,
unsafe fn from_bytes_unchecked(bytes: &[u8]) -> &Selfwhere
Self: Sized,
§Safety
TODO
Sourceunsafe fn from_bytes_mut_unchecked(bytes: &mut [u8]) -> &mut Selfwhere
Self: Sized,
unsafe fn from_bytes_mut_unchecked(bytes: &mut [u8]) -> &mut Selfwhere
Self: Sized,
§Safety
TODO