[][src]Enum pkgsrc::plist::PlistEntry

pub enum PlistEntry {
    File(OsString),
    Cwd(OsString),
    Exec(OsString),
    UnExec(OsString),
    Mode(Option<String>),
    PkgOpt(PlistOption),
    Owner(Option<String>),
    Group(Option<String>),
    Comment(Option<OsString>),
    Ignore,
    Name(String),
    PkgDir(OsString),
    DirRm(OsString),
    Display(OsString),
    PkgDep(String),
    BldDep(String),
    PkgCfl(String),
}

A single plist entry.

Entries can be constructed either by using from_bytes() to parse an array of bytes from a plist, or by constructing one of the entries manually.

Examples

use pkgsrc::plist::{Result,PlistEntry};
use std::ffi::OsString;

fn main() -> Result<()> {
    /*
     * Entries differ in whether they take String or OsString arguments and
     * whether or not they are wrapped in Option, check the documentation!
     */
    let p1 = PlistEntry::from_bytes(String::from("@comment hi").as_bytes())?;
    let p2 = PlistEntry::Comment(Some(OsString::from("hi")));

    assert_eq!(p1, p2);

    Ok(())
}

Variants

File(OsString)

Filename to extract relative to the current working directory.

Set the internal directory pointer. All subsequent filenames will be assumed relative to this directory.

Exec(OsString)

Execute command as part of the unpacking process.

UnExec(OsString)

Execute command as part of the deinstallation process.

Mode(Option<String>)

Set default permission for all subsequently extracted files.

PkgOpt(PlistOption)

Set internal package options. Named Opt to avoid conflict with Rust "Option".

Owner(Option<String>)

Set default ownership for all subsequently extracted files to specified user.

Group(Option<String>)

Set default group ownership for all subsequently extracted files to specified group.

Comment(Option<OsString>)

Embed a comment in the packing list. While specified as mandatory in the manual page, in practise it is not (e.g. print-PLIST).

Ignore

Used internally to tell extraction to ignore the next file.

Name(String)

Set the name of the package.

PkgDir(OsString)

Declare directory name as managed.

DirRm(OsString)

If directory name exists, it will be deleted at deinstall time.

Display(OsString)

Declare name as the file to be displayed at install time.

PkgDep(String)

Declare a dependency on the pkgname package.

BldDep(String)

Declare that this package was built with the exact version of pkgname.

PkgCfl(String)

Declare a conflict with the pkgcflname package.

Methods

impl PlistEntry[src]

pub fn from_bytes(bytes: &[u8]) -> Result<PlistEntry>[src]

Construct a new PlistEntry from a stream of bytes representing a line from a package list.

Trait Implementations

impl Eq for PlistEntry[src]

impl PartialEq<PlistEntry> for PlistEntry[src]

impl Debug for PlistEntry[src]

Auto Trait Implementations

Blanket Implementations

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

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

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.

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.

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

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

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