pub fn parse_value(meta: Meta, value: &[u8]) -> Result<Self, String> {
		let value = match meta.kind {
			Kind::CString => Value::CString(CString::new(value).map_err(|_| format!("value for option {} contains a null byte", meta.name))?),
			Kind::CLong   => Value::CLong(parse_long(value).map_err(|_| format!("invalid integer value for option {}", meta.name))?),
		};

		Ok(Self{name: meta.name, option: meta.option, value})
	}
/// Parse the value for an option with known metadata.
Parse the value for an option with known metadata.
Parse the value for an option with known metadata .
pub fn parse_value(meta: Meta, value: &[u8]) -> Result<Self, String> {
		let value = match meta.kind {
			Kind::CString => Value::CString(CString::new(value).map_err(|_| format!("value for option {} contains a null byte", meta.name))?),
			Kind::CLong   => Value::CLong(parse_long(value).map_err(|_| format!("invalid integer value for option {}", meta.name))?),
		};
		Ok(Self{name: meta.name, option: meta.option, value})
	}
pub fn parse_value ( meta : Meta , value : & [ u8 ] ) -> Result < Self , String > { let value = match meta . kind { Kind :: CString => Value :: CString ( CString :: new ( value ) . map_err ( | _ | format ! ( " " meta name ) ) ? ) , Kind :: CLong => Value :: CLong ( parse_long ( value ) . map_err ( | _ | format ! ( " " meta name ) ) ? ) , } ; Ok ( Self { name : meta . name , option : meta . option , value } ) }
Parse the value for an option with known metadata.
Parse the value for an option with known metadata .
meta
Meta
value
&[u8]
meta
Meta
value
&[u8]