Struct cargo_gazelle::config::CrateConfig
source · pub struct CrateConfig {
skip_generating: bool,
additive_content: Option<String>,
lib: LibraryConfig,
build: BuildConfig,
tests: BTreeMap<String, TestConfig>,
binaries: BTreeMap<String, BinaryConfig>,
}
Expand description
Extra configuration for the Bazel targets generated for a crate.
We should try to make generating BUILD.bazel
files is as seamless as possible, but there are
instances where this isn’t possible. For example, some tests rely on text-based snapshot files
that Bazel needs to know about so it can include them in the sandbox. But Rust/Cargo has no way
of formally declaring a dependency on these files so we must manually specify them.
Fields§
§skip_generating: bool
Should we skip generating a BUILD.bazel
file entirely for this crate.
additive_content: Option<String>
Additive content we paste at the bottom of the generated BUILD.bazel
file.
lib: LibraryConfig
Extra config for the rust_library
target.
build: BuildConfig
Extra config for the cargo_build_script
target.
tests: BTreeMap<String, TestConfig>
Extra config for any test targets.
binaries: BTreeMap<String, BinaryConfig>
Extra config for any binary targets.
Implementations§
source§impl CrateConfig
impl CrateConfig
pub fn new(package: &PackageMetadata<'_>) -> Self
pub fn skip_generating(&self) -> bool
pub fn additive_content(&self) -> Option<AdditiveContent>
pub fn lib(&self) -> &LibraryConfig
pub fn lib_test(&self) -> &TestConfig
pub fn doc_test(&self) -> &TestConfig
pub fn build(&self) -> &BuildConfig
pub fn test(&self, name: &str) -> &TestConfig
pub fn binary(&self, name: &str) -> &BinaryConfig
Trait Implementations§
source§impl Debug for CrateConfig
impl Debug for CrateConfig
source§impl Default for CrateConfig
impl Default for CrateConfig
source§fn default() -> CrateConfig
fn default() -> CrateConfig
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for CrateConfig
impl<'de> Deserialize<'de> for CrateConfig
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for CrateConfig
impl RefUnwindSafe for CrateConfig
impl Send for CrateConfig
impl Sync for CrateConfig
impl Unpin for CrateConfig
impl UnwindSafe for CrateConfig
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