[][src]Struct wasm_pack::manifest::CrateData

pub struct CrateData { /* fields omitted */ }

Store for metadata learned about a crate

Methods

impl CrateData[src]

pub fn new(
    crate_path: &Path,
    out_name: Option<String>
) -> Result<CrateData, Error>
[src]

Reads all metadata for the crate whose manifest is inside the directory specified by path.

pub fn parse_crate_data(
    manifest_path: &Path
) -> Result<ManifestAndUnsedKeys, Error>
[src]

Read the manifest_path file and deserializes it using the toml Deserializer. Returns a Result containing ManifestAndUnsedKeys which contains CargoManifest and a BTreeSet<String> containing the unused keys from the parsed file.

Errors

Will return Err if the file (manifest_path) couldn't be read or if deserialize to CargoManifest fails.

pub fn warn_for_unused_keys(manifest_and_keys: &ManifestAndUnsedKeys)[src]

Iterating through all the passed unused_keys and output a warning for each unknown key.

pub fn configured_profile(&self, profile: BuildProfile) -> &CargoWasmPackProfile[src]

Get the configured profile.

pub fn check_crate_config(&self) -> Result<(), Error>[src]

Check that the crate the given path is properly configured.

pub fn crate_name(&self) -> String[src]

Get the crate name for the crate at the given path.

pub fn name_prefix(&self) -> String[src]

Get the prefix for output file names

pub fn crate_license(&self) -> &Option<String>[src]

Get the license for the crate at the given path.

pub fn crate_license_file(&self) -> &Option<String>[src]

Get the license file path for the crate at the given path.

pub fn target_directory(&self) -> &Path[src]

Returns the path to this project's target directory where artifacts are located after a cargo build.

pub fn workspace_root(&self) -> &Path[src]

Returns the path to this project's root cargo workspace directory

pub fn write_package_json(
    &self,
    out_dir: &Path,
    scope: &Option<String>,
    disable_dts: bool,
    target: Target
) -> Result<(), Error>
[src]

Generate a package.json file inside in ./pkg.

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> Erased for T

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

impl<T, U> Into<U> for T where
    U: From<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, U> TryInto<U> for T where
    U: TryFrom<T>, 

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