Trait graph::input::ParseValue[][src]

pub trait ParseValue: Default + Sized {
    fn parse(bytes: &[u8]) -> (Self, usize);
}
Expand description

Used by input formats to read node or edge values from bytes.

Required methods

Parses a value from a slice.

Example
use graph::input::ParseValue;

let bytes = "13.37".as_bytes();

let (number, len) = f32::parse(bytes);

assert_eq!(number, 13.37);
assert_eq!(len, 5);
Return

Returns a tuple containing two entries. The first is the parsed value, the second is the index of the byte right after the parsed value.

Implementations on Foreign Types

Implementors