Trait sfv::ParseMore

source ·
pub trait ParseMore {
    // Required method
    fn parse_more(&mut self, input_bytes: &[u8]) -> Result<(), &'static str>
       where Self: Sized;
}
Expand description

If structured field value of List or Dictionary type is split into multiple lines, allows to parse more lines and merge them into already existing structure field value.

Required Methods§

source

fn parse_more(&mut self, input_bytes: &[u8]) -> Result<(), &'static str>
where Self: Sized,

If structured field value is split across lines, parses and merges next line into a single structured field value.

Examples

let mut list_field = Parser::parse_list("11, (12 13)".as_bytes()).unwrap();
list_field.parse_more("\"foo\",        \"bar\"".as_bytes()).unwrap();

assert_eq!(list_field.serialize_value().unwrap(), "11, (12 13), \"foo\", \"bar\"");

Implementors§