[][src]Struct oceanpkg::drop::manifest::Manifest

pub struct Manifest {
    pub meta: Meta,
    pub deps: Option<Deps>,
}

A drop manifest.

Note the lack of drop::Name usage throughout this type. This is because name validation is done by the backend in order for clients to be forward-compatible with later backend versions.

Fields

meta: Meta

The drop's info.

deps: Option<Deps>

The drops that this drop relies on.

Methods

impl Manifest[src]

pub const FILE_NAME: &'static str[src]

The name used for manifest files.

pub fn parse_json(json: &str) -> Result<Self, Error>[src]

Parses a manifest from JSON.

use oceanpkg::drop::Manifest;

let json = r#"{
    "meta": {
        "name": "ocean",
        "description": "Cross-platform package manager",
        "version": "0.1.0",
        "license": "AGPL-3.0-only",
        "authors": ["Nikolai Vazquez", "Alex Farra", "Nicole Zhao"],
        "readme": "README.md",
        "changelog": "CHANGELOG.md",
        "git": "https://github.com/oceanpkg/ocean"
    },
    "dependencies": {
        "wget": "*"
    }
}"#;
let manifest = Manifest::parse_json(json).unwrap();

pub fn read_json<J>(json: J) -> Result<Self, Error> where
    J: Read
[src]

Parses a manifest from JSON provided by the reader.

pub fn read_json_file<J>(json: J) -> Result<Self, Error> where
    J: AsRef<Path>, 
[src]

Parses a manifest from a JSON file at the given path.

pub fn to_json(&self, pretty: bool) -> Result<String, Error>[src]

Returns self as a JSON string.

pub fn files(&self) -> Vec<&str>[src]

Returns the list of files to package.

Trait Implementations

impl Clone for Manifest[src]

impl Debug for Manifest[src]

impl<'de> Deserialize<'de> for Manifest[src]

impl Eq for Manifest[src]

impl Hash for Manifest[src]

impl PartialEq<Manifest> for Manifest[src]

impl Serialize for Manifest[src]

impl StructuralEq for Manifest[src]

impl StructuralPartialEq for Manifest[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

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

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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

type Error = !

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.