Struct rustympkglib::pkgbuild::Pkgbuild[][src]

pub struct Pkgbuild {
    pub source: Vec<u8>,
    pub parser: Parser,
    pub tree: Tree,
}

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: Parsertree: Tree

Implementations

impl Pkgbuild[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>>());

Auto Trait Implementations

impl RefUnwindSafe for Pkgbuild

impl Send for Pkgbuild

impl !Sync for Pkgbuild

impl Unpin for Pkgbuild

impl UnwindSafe for Pkgbuild

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.