#[non_exhaustive]pub struct CompilationUnitComponentMetadata {
pub package: PackageId,
pub name: String,
pub source_path: Utf8PathBuf,
pub cfg: Option<Vec<Cfg>>,
pub id: Option<CompilationUnitComponentId>,
pub discriminator: Option<String>,
pub dependencies: Option<Vec<CompilationUnitComponentDependencyMetadata>>,
pub extra: HashMap<String, Value>,
}Expand description
Information to pass to the Cairo compiler about a package that is a component of a compilation unit.
List of components can be used to construct the [crate_roots] section of cairo_project.toml.
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.package: PackageIdPackage ID.
name: StringName of the package to pass to the Cairo compiler.
This may not be equal to Scarb package name in the future.
source_path: Utf8PathBufPath to the root Cairo source file.
cfg: Option<Vec<Cfg>>Items for the Cairo’s #[cfg(...)] attribute to be enabled in this component.
If not specified, the one from CompilationUnit will be used.
id: Option<CompilationUnitComponentId>Identifier of this component. It is unique in its compilation unit.
discriminator: Option<String>Identifier of this component as a dependency.
This directly translates to a discriminator field in Cairo compiler terminology.
If [CompilationUnitComponentMetadata.id] is Some
then this field is None for core crate only.
dependencies: Option<Vec<CompilationUnitComponentDependencyMetadata>>Dependencies of this component. Contains libraries and plugins, represented uniquely in the scope of the compilation unit.
extra: HashMap<String, Value>Additional data not captured by deserializer.
Implementations§
Source§impl CompilationUnitComponentMetadata
impl CompilationUnitComponentMetadata
Sourcepub fn source_root(&self) -> &Utf8Path
pub fn source_root(&self) -> &Utf8Path
Path to the source directory of the component.
Trait Implementations§
Source§impl Clone for CompilationUnitComponentMetadata
impl Clone for CompilationUnitComponentMetadata
Source§fn clone(&self) -> CompilationUnitComponentMetadata
fn clone(&self) -> CompilationUnitComponentMetadata
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<'de> Deserialize<'de> for CompilationUnitComponentMetadata
impl<'de> Deserialize<'de> for CompilationUnitComponentMetadata
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for CompilationUnitComponentMetadata
impl PartialEq for CompilationUnitComponentMetadata
Source§fn eq(&self, other: &CompilationUnitComponentMetadata) -> bool
fn eq(&self, other: &CompilationUnitComponentMetadata) -> bool
self and other values to be equal, and is used by ==.