pub trait IoDeSer {
// Required methods
fn to_io_string(&self, tab: u8) -> String;
fn from_io_string(io_input: &mut String) -> Result<Self>
where Self: Sized;
}Expand description
Required Methods§
sourcefn to_io_string(&self, tab: u8) -> String
fn to_io_string(&self, tab: u8) -> String
Serializes self into .io file format.
§Arguments
tab- Starting number of tabulators in String. At the beginning should be equal to 0.
sourcefn from_io_string(io_input: &mut String) -> Result<Self>where
Self: Sized,
fn from_io_string(io_input: &mut String) -> Result<Self>where
Self: Sized,
Deserializes .io formatted String into Self.
Returns result with deserialized object or errors::Error.
§Arguments
io_input- .io formatted String.
§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)