pub struct SourceInfoContent {
pub preceding_lines: Vec<Ignored>,
pub package_base: RawPackageBase,
pub packages: Vec<RawPackage>,
}Expand description
A representation of all high-level components of parsed SRCINFO data.
Fields§
§preceding_lines: Vec<Ignored>Empty or comment lines that occur outside of pkgbase or pkgname sections.
package_base: RawPackageBase§packages: Vec<RawPackage>Implementations§
Source§impl SourceInfoContent
impl SourceInfoContent
Sourcepub fn parser(input: &mut &str) -> ModalResult<SourceInfoContent>
pub fn parser(input: &mut &str) -> ModalResult<SourceInfoContent>
Recognizes a complete SRCINFO file from a string slice.
use alpm_srcinfo::parser::SourceInfoContent;
use winnow::Parser;
let source_info_data = r#"
pkgbase = example
pkgver = 1.0.0
epoch = 1
pkgrel = 1
pkgdesc = A project that does something
url = https://example.org/
arch = x86_64
depends = glibc
optdepends = python: for special-python-script.py
makedepends = cmake
checkdepends = extra-test-tool
pkgname = example
depends = glibc
depends = gcc-libs
"#;
// Parse the given srcinfo content.
let parsed = SourceInfoContent::parser
.parse(source_info_data)
.map_err(|err| alpm_srcinfo::Error::ParseError(format!("{err}")))?;Trait Implementations§
Auto Trait Implementations§
impl Freeze for SourceInfoContent
impl RefUnwindSafe for SourceInfoContent
impl !Send for SourceInfoContent
impl !Sync for SourceInfoContent
impl Unpin for SourceInfoContent
impl UnwindSafe for SourceInfoContent
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