Struct rustympkglib::pkgbuild::Pkgbuild [−][src]
Struct used to parse a PKGBUILD file. This contains fairly low-level fields such as the
parser
and the source code.
This won’t fetch any of the data inside the PKGBUILD file. To parse the data and make it available inside Rust, you’ll want to use PkgData.
Fields
source: Vec<u8>
parser: Parser
tree: Tree
Implementations
impl Pkgbuild
[src]
impl Pkgbuild
[src]pub fn new(source: &str) -> Result<Pkgbuild, Error>
[src]
pub fn new(source: &str) -> Result<Pkgbuild, Error>
[src]Create a new Pkgbuild from a given PKGBUILD source code
let source_code = r#" pkgname=testing-package pkgver=0.1.0 pkgrel=1 arch=('any') license=('MIT') "#; let pkgbuild = Pkgbuild::new(&source_code).unwrap(); assert_eq!(pkgbuild.source, source_code.as_bytes().iter().copied().collect::<Vec<u8>>());