[][src]Trait memflow::types::byte_swap::ByteSwap

pub trait ByteSwap {
    fn byte_swap(&mut self);
}

A trait specifying that a type/struct can be byte swapped.

This is especially useful when reading/writing from/to targets with a different architecture to the one memflow is compiled with.

Examples

use memflow::types::ByteSwap;
use memflow_derive::*;

#[repr(C)]
#[derive(ByteSwap)]
pub struct Test {
    pub type1: i32,
    pub type2: u32,
    pub type3: i64,
}

let mut test = Test {
    type1: 10,
    type2: 1234,
    type3: -1234,
};
test.byte_swap();

Required methods

fn byte_swap(&mut self)

Loading content...

Implementations on Foreign Types

impl ByteSwap for i8[src]

impl ByteSwap for i16[src]

impl ByteSwap for i32[src]

impl ByteSwap for i64[src]

impl ByteSwap for i128[src]

impl ByteSwap for isize[src]

impl ByteSwap for u8[src]

impl ByteSwap for u16[src]

impl ByteSwap for u32[src]

impl ByteSwap for u64[src]

impl ByteSwap for u128[src]

impl ByteSwap for usize[src]

impl ByteSwap for f32[src]

impl ByteSwap for f64[src]

impl<T: 'static> ByteSwap for *const T[src]

impl<T: 'static> ByteSwap for *mut T[src]

impl<T: 'static> ByteSwap for PhantomData<T>[src]

impl<T: ByteSwap> ByteSwap for [T][src]

Loading content...

Implementors

impl<T: ?Sized + 'static> ByteSwap for Pointer32<T>[src]

impl<T: ?Sized + 'static> ByteSwap for Pointer64<T>[src]

Loading content...