pub struct ExtraDataEntry {
key: String,
value: String,
}Expand description
Extra data entry associated with a package
This type wraps a key-value pair of data as String, which is separated by an equal sign (=).
Fields§
§key: String§value: StringImplementations§
Trait Implementations§
Source§impl Clone for ExtraDataEntry
impl Clone for ExtraDataEntry
Source§fn clone(&self) -> ExtraDataEntry
fn clone(&self) -> ExtraDataEntry
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ExtraDataEntry
impl Debug for ExtraDataEntry
Source§impl<'de> Deserialize<'de> for ExtraDataEntry
impl<'de> Deserialize<'de> for ExtraDataEntry
Source§fn deserialize<__D>(deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for ExtraDataEntry
impl Display for ExtraDataEntry
Source§impl FromStr for ExtraDataEntry
impl FromStr for ExtraDataEntry
Source§fn from_str(s: &str) -> Result<Self, Self::Err>
fn from_str(s: &str) -> Result<Self, Self::Err>
Parses an extra_data from string.
The string is expected to be in the format key=value.
§Errors
This function returns an error if the string is missing the key or value component.
§Examples
use std::str::FromStr;
use alpm_types::{ExtraDataEntry, PackageType};
// create ExtraDataEntry from str
let extra_data: ExtraDataEntry = ExtraDataEntry::from_str("pkgtype=debug")?;
assert_eq!(extra_data.key(), "pkgtype");
assert_eq!(extra_data.value(), "debug");Source§impl PartialEq for ExtraDataEntry
impl PartialEq for ExtraDataEntry
Source§impl Serialize for ExtraDataEntrywhere
Self: Display,
impl Serialize for ExtraDataEntrywhere
Self: Display,
Source§impl TryFrom<ExtraDataEntry> for ExtraData
impl TryFrom<ExtraDataEntry> for ExtraData
Source§fn try_from(value: ExtraDataEntry) -> Result<Self, Self::Error>
fn try_from(value: ExtraDataEntry) -> Result<Self, Self::Error>
Creates an ExtraData from a single ExtraDataEntry.
Delegates to TryFrom::try_from for Vec<ExtraDataEntry>.
§Errors
If the TryFrom::try_from for Vec<ExtraDataEntry> returns an error.
impl StructuralPartialEq for ExtraDataEntry
Auto Trait Implementations§
impl Freeze for ExtraDataEntry
impl RefUnwindSafe for ExtraDataEntry
impl Send for ExtraDataEntry
impl Sync for ExtraDataEntry
impl Unpin for ExtraDataEntry
impl UnwindSafe for ExtraDataEntry
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
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