pub type RawField<'a> = Field<&'a str, &'a str>;Expand description
Raw string field of a .SRCINFO file.
Aliased Type§
pub struct RawField<'a> { /* private fields */ }Implementations§
Source§impl<'a> RawField<'a>
impl<'a> RawField<'a>
Sourcepub fn parse_raw(input: &'a str) -> Self
pub fn parse_raw(input: &'a str) -> Self
Without architecture:
let raw_field = RawField::parse_raw("source");
assert_eq!(raw_field.name_str(), "source");
assert_eq!(raw_field.architecture_str(), None);With architecture:
let raw_field = RawField::parse_raw("source_x86_64");
assert_eq!(raw_field.name_str(), "source");
assert_eq!(raw_field.architecture_str(), Some("x86_64"));Sourcepub fn to_parsed<Name, Architecture>(
&self,
) -> Result<Field<Name, Architecture>, ParseFieldError<<&'a str as TryInto<Name>>::Error, <&'a str as TryInto<Architecture>>::Error>>
pub fn to_parsed<Name, Architecture>( &self, ) -> Result<Field<Name, Architecture>, ParseFieldError<<&'a str as TryInto<Name>>::Error, <&'a str as TryInto<Architecture>>::Error>>
Try converting a RawField into a Field<Name, Architecture>.
let raw_field = RawField::parse_raw("source_x86_64");
let parsed_field: ParsedField<&str> = raw_field.to_parsed().unwrap();
assert_eq!(parsed_field.name(), &FieldName::Source);
assert_eq!(parsed_field.architecture_str(), Some("x86_64"));