The ToBytes
and IterBytes
traits
Cb
IterBytes
ToBytes
of IterBytes for bool
of IterBytes for u8
of IterBytes for u16
of IterBytes for u32
of IterBytes for u64
of IterBytes for i8
of IterBytes for i16
of IterBytes for i32
of IterBytes for i64
of IterBytes for char
of IterBytes for int
of IterBytes for &[A]
of IterBytes for (A, B)
of IterBytes for (A, B, C)
of IterBytes for ~[A]
of IterBytes for @[A]
of IterBytes for &str
of IterBytes for ~str
of IterBytes for @str
of IterBytes for Option<A>
of IterBytes for &A
of IterBytes for @A
of IterBytes for ~A
of IterBytes for *const A
of ToBytes for A
borrow
iter_bytes_2
iter_bytes_3
iter_bytes_4
iter_bytes_5
iter_bytes_6
iter_bytes_7
to_bytes::x64
Cb
type Cb = &fn(buf: &[const u8]) -> bool
IterBytes
A trait to implement in order to make a type hashable; This works in combination with the trait Hash::Hash
, and may in the future be merged with that trait or otherwise modified when default methods and trait inheritence are completed.
iter_bytes
fn iter_bytes(lsb0: bool, f: Cb)
Call the provided callback f
one or more times with byte-slices that should be used when computing a hash value or otherwise "flattening" the structure into a sequence of bytes. The lsb0
parameter conveys whether the caller is asking for little-endian bytes (true
) or big-endian (false
); this should only be relevant in implementations that represent a single multi-byte datum such as a 32 bit integer or 64 bit floating-point value. It can be safely ignored for larger structured types as they are usually processed left-to-right in declaration order, regardless of underlying memory endianness.
ToBytes
to_bytes
fn to_bytes(lsb0: bool) -> ~[u8]
IterBytes
for bool
iter_bytes
fn iter_bytes(_lsb0: bool, f: Cb)
IterBytes
for u8
iter_bytes
fn iter_bytes(_lsb0: bool, f: Cb)
IterBytes
for u16
iter_bytes
fn iter_bytes(lsb0: bool, f: Cb)
IterBytes
for u32
iter_bytes
fn iter_bytes(lsb0: bool, f: Cb)
IterBytes
for u64
iter_bytes
fn iter_bytes(lsb0: bool, f: Cb)
IterBytes
for i8
iter_bytes
fn iter_bytes(lsb0: bool, f: Cb)
IterBytes
for i16
iter_bytes
fn iter_bytes(lsb0: bool, f: Cb)
IterBytes
for i32
iter_bytes
fn iter_bytes(lsb0: bool, f: Cb)
IterBytes
for i64
iter_bytes
fn iter_bytes(lsb0: bool, f: Cb)
IterBytes
for char
iter_bytes
fn iter_bytes(lsb0: bool, f: Cb)
IterBytes
for int
iter_bytes
fn iter_bytes(lsb0: bool, f: Cb)
IterBytes
for &[A]
iter_bytes
fn iter_bytes(lsb0: bool, f: Cb)
IterBytes
for (A, B)
iter_bytes
fn iter_bytes(lsb0: bool, f: Cb)
IterBytes
for (A, B, C)
iter_bytes
fn iter_bytes(lsb0: bool, f: Cb)
IterBytes
for ~[A]
iter_bytes
fn iter_bytes(lsb0: bool, f: Cb)
IterBytes
for @[A]
iter_bytes
fn iter_bytes(lsb0: bool, f: Cb)
IterBytes
for &str
iter_bytes
fn iter_bytes(_lsb0: bool, f: Cb)
IterBytes
for ~str
iter_bytes
fn iter_bytes(_lsb0: bool, f: Cb)
IterBytes
for @str
iter_bytes
fn iter_bytes(_lsb0: bool, f: Cb)
IterBytes
for Option<A>
iter_bytes
fn iter_bytes(lsb0: bool, f: Cb)
IterBytes
for &A
iter_bytes
fn iter_bytes(lsb0: bool, f: Cb)
IterBytes
for @A
iter_bytes
fn iter_bytes(lsb0: bool, f: Cb)
IterBytes
for ~A
iter_bytes
fn iter_bytes(lsb0: bool, f: Cb)
IterBytes
for *const A
iter_bytes
fn iter_bytes(lsb0: bool, f: Cb)
ToBytes
for A
to_bytes
fn to_bytes(lsb0: bool) -> ~[u8]
borrow
fn borrow<A>(a: &x/[A]) -> &x/[A]
iter_bytes_2
fn iter_bytes_2<A: IterBytes, B: IterBytes>(a: &A, b: &B, lsb0: bool, z: Cb)
iter_bytes_3
fn iter_bytes_3<A: IterBytes, B: IterBytes,
C: IterBytes>(a: &A, b: &B, c: &C, lsb0: bool, z: Cb)
iter_bytes_4
fn iter_bytes_4<A: IterBytes, B: IterBytes, C: IterBytes,
D: IterBytes>(a: &A, b: &B, c: &C, d: &D, lsb0: bool, z: Cb)
iter_bytes_5
fn iter_bytes_5<A: IterBytes, B: IterBytes, C: IterBytes, D: IterBytes,
E: IterBytes>(a: &A, b: &B, c: &C, d: &D, e: &E, lsb0: bool,
z: Cb)
iter_bytes_6
fn iter_bytes_6<A: IterBytes, B: IterBytes, C: IterBytes, D: IterBytes,
E: IterBytes,
F: IterBytes>(a: &A, b: &B, c: &C, d: &D, e: &E, f: &F,
lsb0: bool, z: Cb)
iter_bytes_7
fn iter_bytes_7<A: IterBytes, B: IterBytes, C: IterBytes, D: IterBytes,
E: IterBytes, F: IterBytes,
G: IterBytes>(a: &A, b: &B, c: &C, d: &D, e: &E, f: &F, g: &G,
lsb0: bool, z: Cb)