pub struct CrateMetadata {
pub manifest_path: ManifestPath,
pub cargo_meta: Metadata,
pub contract_artifact_name: String,
pub root_package: Package,
pub original_code: PathBuf,
pub dest_code: PathBuf,
pub ink_version: Version,
pub documentation: Option<Url>,
pub homepage: Option<Url>,
pub user: Option<Map<String, Value>>,
pub target_directory: PathBuf,
pub target_file_path: PathBuf,
}
Expand description
Relevant metadata obtained from Cargo.toml.
Fields§
§manifest_path: ManifestPath
§cargo_meta: Metadata
§contract_artifact_name: String
§root_package: Package
§original_code: PathBuf
§dest_code: PathBuf
§ink_version: Version
§documentation: Option<Url>
§homepage: Option<Url>
§user: Option<Map<String, Value>>
§target_directory: PathBuf
§target_file_path: PathBuf
Implementations§
Source§impl CrateMetadata
impl CrateMetadata
Sourcepub fn from_manifest_path(
manifest_path: Option<&PathBuf>,
target: Target,
) -> Result<Self>
pub fn from_manifest_path( manifest_path: Option<&PathBuf>, target: Target, ) -> Result<Self>
Attempt to construct CrateMetadata
from the given manifest path.
Sourcepub fn collect(manifest_path: &ManifestPath, target: Target) -> Result<Self>
pub fn collect(manifest_path: &ManifestPath, target: Target) -> Result<Self>
Parses the contract manifest and returns relevant metadata.
Sourcepub fn metadata_path(&self) -> PathBuf
pub fn metadata_path(&self) -> PathBuf
Get the path of the contract metadata file
Sourcepub fn contract_bundle_path(&self) -> PathBuf
pub fn contract_bundle_path(&self) -> PathBuf
Get the path of the contract bundle, containing metadata + code.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CrateMetadata
impl RefUnwindSafe for CrateMetadata
impl Send for CrateMetadata
impl Sync for CrateMetadata
impl Unpin for CrateMetadata
impl UnwindSafe for CrateMetadata
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more