pub struct Field<Name, Architecture> { /* private fields */ }Expand description
Field of a .SRCINFO file.
Implementations§
Source§impl<Name, Architecture> Field<Name, Architecture>
impl<Name, Architecture> Field<Name, Architecture>
Source§impl<'a> Field<&'a str, &'a str>
impl<'a> Field<&'a str, &'a str>
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"));Source§impl<Name, Architecture> Field<Name, Architecture>
impl<Name, Architecture> Field<Name, Architecture>
Sourcepub fn with_name<NewName>(self, name: NewName) -> Field<NewName, Architecture>
pub fn with_name<NewName>(self, name: NewName) -> Field<NewName, Architecture>
Replace the name of the field.
Sourcepub fn with_architecture<NewArchitecture>(
self,
architecture: Option<NewArchitecture>,
) -> Field<Name, NewArchitecture>
pub fn with_architecture<NewArchitecture>( self, architecture: Option<NewArchitecture>, ) -> Field<Name, NewArchitecture>
Replace the architecture suffix of the field.
Sourcepub const fn architecture(&self) -> Option<&Architecture>
pub const fn architecture(&self) -> Option<&Architecture>
Get an immutable reference to the architecture suffix of the field.
Sourcepub fn into_components(self) -> (Name, Option<Architecture>)
pub fn into_components(self) -> (Name, Option<Architecture>)
Destructure into a tuple of field name and architecture.
Trait Implementations§
Source§impl<'a, Name, Architecture> TryFrom<&'a str> for Field<Name, Architecture>
impl<'a, Name, Architecture> TryFrom<&'a str> for Field<Name, Architecture>
impl<Name: Copy, Architecture: Copy> Copy for Field<Name, Architecture>
impl<Name: Eq, Architecture: Eq> Eq for Field<Name, Architecture>
impl<Name, Architecture> StructuralPartialEq for Field<Name, Architecture>
Auto Trait Implementations§
impl<Name, Architecture> Freeze for Field<Name, Architecture>
impl<Name, Architecture> RefUnwindSafe for Field<Name, Architecture>where
Name: RefUnwindSafe,
Architecture: RefUnwindSafe,
impl<Name, Architecture> Send for Field<Name, Architecture>
impl<Name, Architecture> Sync for Field<Name, Architecture>
impl<Name, Architecture> Unpin for Field<Name, Architecture>
impl<Name, Architecture> UnwindSafe for Field<Name, Architecture>where
Name: UnwindSafe,
Architecture: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<X> Pipe for X
impl<X> Pipe for X
Source§fn pipe_ref<'a, Return, Function>(&'a self, f: Function) -> Returnwhere
Function: FnOnce(&'a Self) -> Return,
fn pipe_ref<'a, Return, Function>(&'a self, f: Function) -> Returnwhere
Function: FnOnce(&'a Self) -> Return,
Source§fn pipe_mut<'a, Return, Function>(&'a mut self, f: Function) -> Returnwhere
Function: FnOnce(&'a mut Self) -> Return,
fn pipe_mut<'a, Return, Function>(&'a mut self, f: Function) -> Returnwhere
Function: FnOnce(&'a mut Self) -> Return,
Source§fn pipe_as_ref<'a, Param, Return, Function>(&'a self, f: Function) -> Return
fn pipe_as_ref<'a, Param, Return, Function>(&'a self, f: Function) -> Return
Apply
f to &self where f takes a single parameter of type Param
and Self implements trait AsRef<Param>. Read moreSource§fn pipe_as_mut<'a, Param, Return, Function>(&'a mut self, f: Function) -> Return
fn pipe_as_mut<'a, Param, Return, Function>(&'a mut self, f: Function) -> Return
Apply
f to &mut self where f takes a single parameter of type Param
and Self implements trait AsMut<Param>. Read moreSource§fn pipe_deref<'a, Param, Return, Function>(&'a self, f: Function) -> Return
fn pipe_deref<'a, Param, Return, Function>(&'a self, f: Function) -> Return
Apply
f to &self where f takes a single parameter of type Param
and Self implements trait Deref<Target = Param>. Read moreSource§fn pipe_deref_mut<'a, Param, Return, Function>(
&'a mut self,
f: Function,
) -> Returnwhere
Self: DerefMut<Target = Param>,
Param: 'a + ?Sized,
Function: FnOnce(&'a mut Param) -> Return,
fn pipe_deref_mut<'a, Param, Return, Function>(
&'a mut self,
f: Function,
) -> Returnwhere
Self: DerefMut<Target = Param>,
Param: 'a + ?Sized,
Function: FnOnce(&'a mut Param) -> Return,
Apply
f to &mut self where f takes a single parameter of type Param
and Self implements trait DerefMut<Target = Param>. Read moreSource§fn pipe_borrow<'a, Param, Return, Function>(&'a self, f: Function) -> Return
fn pipe_borrow<'a, Param, Return, Function>(&'a self, f: Function) -> Return
Apply
f to &self where f takes a single parameter of type Param
and Self implements trait Borrow<Param>. Read moreSource§fn pipe_borrow_mut<'a, Param, Return, Function>(
&'a mut self,
f: Function,
) -> Return
fn pipe_borrow_mut<'a, Param, Return, Function>( &'a mut self, f: Function, ) -> Return
Apply
f to &mut self where f takes a single parameter of type Param
and Self implements trait BorrowMut<Param>. Read more