Struct whiteread::white::Zeroed [] [src]

pub struct Zeroed<T>(pub Vec<T>);

Wrapper for reading vector of numbers represented by a list ending with 0.

Examples

let (Zeroed(v), _): (Zeroed<u8>, String) = parse_string("20 21 22 0 foo").unwrap();
assert_eq!(v, &[20, 21, 22]);

assert!(parse_string::<Zeroed<u8>>("20 21 22").is_err());

If the element can be represented by multiple words (eg. it's a tuple or a vector), the full "zeroed" element should be provided:

let _: Zeroed<(i32, i32)> = parse_string("22 33  44 55  0 0").unwrap();
let _: Zeroed<Lengthed<String>> = parse_string("3 a b c  2 d e  0").unwrap();

Trait Implementations

impl<T: Default> Default for Zeroed<T>
[src]

Returns the "default value" for a type. Read more

impl<T: Debug> Debug for Zeroed<T>
[src]

Formats the value using the given formatter.

impl<T: White + Default + PartialEq> White for Zeroed<T>
[src]