ManifestBuilder

Struct ManifestBuilder 

Source
pub struct ManifestBuilder { /* private fields */ }
Expand description

Builder for Manifest.

Implementations§

Source§

impl ManifestBuilder

Source

pub fn name<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self

The name of the package.

If this is missing, it usually indicates that this package exists only to describe a workspace, similar to Cargo’s notion of a “virtual manifest”.

Source

pub fn version(&mut self, value: Version) -> &mut Self

The version of the package.

Package managers generally require this to be populated to actually publish the package, but will tolerate its absence during local development.

Source

pub fn description<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self

Source

pub fn homepage<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self

Source

pub fn license<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self

Source

pub fn bugs(&mut self, value: Bugs) -> &mut Self

Source

pub fn keywords(&mut self, value: Vec<String>) -> &mut Self

Source

pub fn bin(&mut self, value: Bin) -> &mut Self

Information about the names and locations of binaries this package provides.

Use crate::BuildManifest::from_manifest to get a normalized version of this field (and other related fields).

Source

pub fn author(&mut self, value: PersonField) -> &mut Self

Source

pub fn contributors(&mut self, value: Vec<PersonField>) -> &mut Self

Source

pub fn files(&mut self, value: Option<Vec<String>>) -> &mut Self

Source

pub fn main<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self

Source

pub fn man(&mut self, value: Man) -> &mut Self

Source

pub fn directories(&mut self, value: Option<Directories>) -> &mut Self

Source

pub fn module_type<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self

Source

pub fn exports(&mut self, value: Exports) -> &mut Self

Source

pub fn imports(&mut self, value: Imports) -> &mut Self

Source

pub fn repository(&mut self, value: Repository) -> &mut Self

Information about the repository this project is hosted in.

Repository::Str can contain many different formats (or plain garbage), we recommend trying to .parse() it as oro-package-spec’s GitInfo type, as it understands most of the relevant formats.

Source

pub fn scripts(&mut self, value: HashMap<String, String>) -> &mut Self

Information about build scripts the package uses.

Use crate::BuildManifest::from_manifest to get a normalized version of this field (and other related fields).

Source

pub fn config(&mut self, value: Value) -> &mut Self

Source

pub fn engines(&mut self, value: HashMap<String, Range>) -> &mut Self

Source

pub fn os(&mut self, value: Vec<String>) -> &mut Self

Source

pub fn cpu(&mut self, value: Vec<String>) -> &mut Self

Source

pub fn private(&mut self, value: bool) -> &mut Self

Source

pub fn publish_config(&mut self, value: HashMap<String, Value>) -> &mut Self

Source

pub fn dependencies(&mut self, value: IndexMap<String, String>) -> &mut Self

Source

pub fn dev_dependencies(&mut self, value: IndexMap<String, String>) -> &mut Self

Source

pub fn optional_dependencies( &mut self, value: IndexMap<String, String>, ) -> &mut Self

Source

pub fn peer_dependencies( &mut self, value: IndexMap<String, String>, ) -> &mut Self

Source

pub fn bundled_dependencies( &mut self, value: Option<BundledDependencies>, ) -> &mut Self

Source

pub fn workspaces(&mut self, value: Vec<String>) -> &mut Self

Source

pub fn _rest(&mut self, value: HashMap<String, Value>) -> &mut Self

Source

pub fn build(&self) -> Result<Manifest, ManifestBuilderError>

Builds a new Manifest.

§Errors

If a required field has not been initialized.

Trait Implementations§

Source§

impl Clone for ManifestBuilder

Source§

fn clone(&self) -> ManifestBuilder

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Default for ManifestBuilder

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.