pub struct ArchProperty<T> {
pub architecture: Option<Architecture>,
pub value: T,
}
Expand description
An arbitrarily typed attribute that is specific to an alpm-architecture.
This type is designed to wrap any type that is architecture specific. For example, all checksums may be architecture specific.
§Example
# Without architecture
sha256 = 0db1b39fd70097c6733cdcce56b1559ece5521ec1aad9ee1d520dda73eff03d0
# With architecture
sha256_x86_64 = 0db1b39fd70097c6733cdcce56b1559ece5521ec1aad9ee1d520dda73eff03d0
The above would be reflected by the following code.
use std::str::FromStr;
use alpm_srcinfo::parser::ArchProperty;
use alpm_types::{Architecture, Sha256Checksum};
let without_architecture = ArchProperty {
architecture: None,
value: Sha256Checksum::from_str(
"0db1b39fd70097c6733cdcce56b1559ece5521ec1aad9ee1d520dda73eff03d0",
)?,
};
let with_architecture = ArchProperty {
architecture: Some(Architecture::X86_64),
value: Sha256Checksum::from_str(
"0db1b39fd70097c6733cdcce56b1559ece5521ec1aad9ee1d520dda73eff03d0",
)?,
};
Fields§
§architecture: Option<Architecture>
The optional [alpm-architecture] of the value
.
If architecture
is None
it is considered to be "any"
.
[alpm-architecture]: https://alpm.archlinux.page/specifications/alpm-architecture.7.html
value: T
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for ArchProperty<T>where
T: Freeze,
impl<T> RefUnwindSafe for ArchProperty<T>where
T: RefUnwindSafe,
impl<T> Send for ArchProperty<T>where
T: Send,
impl<T> Sync for ArchProperty<T>where
T: Sync,
impl<T> Unpin for ArchProperty<T>where
T: Unpin,
impl<T> UnwindSafe for ArchProperty<T>where
T: 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