[][src]Trait lazy_bytes_cast::to::ToBytesCast

pub unsafe trait ToBytesCast: Copy {
    fn to_bytes(&self) -> Vec<u8>;
fn copy_to_bytes(&self, to: &mut [u8]) -> Result<(), ()>;
unsafe fn copy_to_bytes_lazy(&self, to: &mut [u8]); }

Trait to provide to_bytes method for a arbitrary data.

This trait is implemented for a basic integer that can be safely converted.

Required methods

fn to_bytes(&self) -> Vec<u8>

Converts to bytes.

fn copy_to_bytes(&self, to: &mut [u8]) -> Result<(), ()>

Writes into byte slice.

unsafe fn copy_to_bytes_lazy(&self, to: &mut [u8])

Unsafe version of copy_to_bytes

Loading content...

Implementations on Foreign Types

impl ToBytesCast for u64[src]

impl ToBytesCast for u32[src]

impl ToBytesCast for u16[src]

impl ToBytesCast for u8[src]

impl ToBytesCast for usize[src]

impl ToBytesCast for i64[src]

impl ToBytesCast for i32[src]

impl ToBytesCast for i16[src]

impl ToBytesCast for i8[src]

impl ToBytesCast for isize[src]

impl ToBytesCast for f32[src]

impl ToBytesCast for f64[src]

impl ToBytesCast for i128[src]

impl ToBytesCast for u128[src]

Loading content...

Implementors

Loading content...