Struct wasm_pack::manifest::CrateData

source ·
pub struct CrateData { /* private fields */ }
Expand description

Store for metadata learned about a crate

Implementations§

source§

impl CrateData

source

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

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

source

pub fn parse_crate_data(manifest_path: &Path) -> Result<ManifestAndUnsedKeys>

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.

source

pub fn warn_for_unused_keys(manifest_and_keys: &ManifestAndUnsedKeys)

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

source

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

Get the configured profile.

source

pub fn check_crate_config(&self) -> Result<()>

Check that the crate the given path is properly configured.

source

pub fn crate_name(&self) -> String

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

source

pub fn name_prefix(&self) -> String

Get the prefix for output file names

source

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

Get the license for the crate at the given path.

source

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

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

source

pub fn target_directory(&self) -> &Path

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

source

pub fn workspace_root(&self) -> &Path

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

source

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

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

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

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

const: unstable · 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> Same<T> for T

§

type Output = T

Should always be Self
source§

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

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more