You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
640 B
Rust
39 lines
640 B
Rust
1 year ago
|
use memflow::types::byte_swap::ByteSwap;
|
||
|
use memflow_derive::*;
|
||
|
|
||
|
#[derive(ByteSwap)]
|
||
|
struct ByteSwapDerive {
|
||
|
pub val: u32,
|
||
|
}
|
||
|
|
||
|
#[derive(ByteSwap)]
|
||
|
struct ByteSwapDeriveGeneric<T: ByteSwap> {
|
||
|
pub val: T,
|
||
|
}
|
||
|
|
||
|
#[derive(ByteSwap)]
|
||
|
struct ByteSwapDeriveWhere<T>
|
||
|
where
|
||
|
T: ByteSwap,
|
||
|
{
|
||
|
pub val: T,
|
||
|
}
|
||
|
|
||
|
#[derive(ByteSwap)]
|
||
|
struct ByteSwapDeriveSlice {
|
||
|
pub slice: [u8; 32],
|
||
|
}
|
||
|
|
||
|
#[derive(ByteSwap)]
|
||
|
struct ByteSwapDeriveStructSlice {
|
||
|
pub slice: [ByteSwapDeriveSlice; 128],
|
||
|
}
|
||
|
|
||
|
#[derive(ByteSwap)]
|
||
|
struct ByteSwapDeriveStructGenericSlice<T: ByteSwap> {
|
||
|
pub slice: [ByteSwapDeriveGeneric<T>; 128],
|
||
|
}
|
||
|
|
||
|
#[test]
|
||
|
pub fn compiles() {}
|