#[non_exhaustive]pub struct Metadata {
pub version: VersionPin,
pub app_exe: Option<PathBuf>,
pub app_version_info: VersionInfo,
pub target_dir: Option<Utf8PathBuf>,
pub runtime_manifest: Utf8PathBuf,
pub workspace: WorkspaceMetadata,
pub packages: Vec<PackageMetadata>,
pub compilation_units: Vec<CompilationUnitMetadata>,
pub current_profile: String,
pub profiles: Vec<String>,
pub extra: HashMap<String, Value>,
}Expand description
Top level data structure printed by scarb metadata.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.version: VersionPinThe metadata format version.
This struct will not deserialize if version does not match.
app_exe: Option<PathBuf>Path to scarb executable.
app_version_info: VersionInfoScarb’s version.
target_dir: Option<Utf8PathBuf>Path to the target (build) directory if known by Scarb at the moment of generating metadata.
runtime_manifest: Utf8PathBufPath to the manifest of package or workspace that Scarb has been run from.
§Compatibility
With very old Scarb versions (<0.5.0), this field may end up being empty path upon
deserializing from scarb metadata call.
In this case, fall back to WorkspaceMetadata.manifest field value.
workspace: WorkspaceMetadataCurrent workspace metadata.
packages: Vec<PackageMetadata>Metadata of all packages used in this workspace, or just members of it if this is an output
of scarb metadata --no-deps.
In the former case, use WorkspaceMetadata::members to filter workspace members.
compilation_units: Vec<CompilationUnitMetadata>List of all Scarb compilation units produced in this workspace.
current_profile: StringName of the currently selected profile
profiles: Vec<String>List of all available profiles names
extra: HashMap<String, Value>Additional data not captured by deserializer.
Implementations§
Source§impl Metadata
impl Metadata
Sourcepub fn get_package(&self, id: &PackageId) -> Option<&PackageMetadata>
pub fn get_package(&self, id: &PackageId) -> Option<&PackageMetadata>
Returns reference to PackageMetadata corresponding to the PackageId.
Sourcepub fn is_builtin_plugin(
&self,
plugin: &CompilationUnitCairoPluginMetadata,
) -> Option<bool>
pub fn is_builtin_plugin( &self, plugin: &CompilationUnitCairoPluginMetadata, ) -> Option<bool>
Checks if the plugin associated with CompilationUnitCairoPluginMetadata is built-in into Scarb.
Sourcepub fn get_compilation_unit(
&self,
id: &CompilationUnitId,
) -> Option<&CompilationUnitMetadata>
pub fn get_compilation_unit( &self, id: &CompilationUnitId, ) -> Option<&CompilationUnitMetadata>
Returns reference to CompilationUnitMetadata corresponding to the CompilationUnitId.