macro_rules! from_io {
($obj: expr, $type: ty) => { ... };
}Expand description
Deserializes .io formatted String into Self.
Returns result with deserialized object or errors::Error.
§Arguments
io_string- .io formatted Stringtype- type of the deserialized object
§Errors
errors::Error::ParseErrorwhen deserializing primitive into wrong typeerrors::Error::IoFormatErrorwhen passed Stringio_inputis in wrong formaterrors::Error::ArrayLengthErrorwhen deserializing array of size X into size Yerrors::Error::FieldNotFoundErrorwhen field X was found in .io formatted String, but provided struct does not have one (might occur because of wrong naming or ordering, see [io_order] and [io_name] attributes)
§Examples
use iodeser::*;
let io_string = /* read from string or .io file */ "|\n\n\n|".to_string();
let object : Vec<i32> = from_io!(io_string, Vec<i32>).unwrap();