[−][src]Struct cargo_scout_lib::config::rust::CargoConfig
This struct represents a Cargo project configuration.
Methods
impl CargoConfig
[src]
pub fn from_manifest_path(p: impl AsRef<Path>) -> Result<Self, Error>
[src]
This function will instantiate a Config from a Cargo.toml path.
If in a workspace, get_members
will return the members
of the [[workspace]] members section in Cargo.toml.
Else, it will return vec![".".to_string()]
cargo-scout-lib example
let config = CargoConfig::from_manifest_path("Cargo.toml")?; // There is only one directory to lint, which is the current one. assert_eq!(vec!["."], config.members());
cargo-scout workspace example
let config = CargoConfig::from_manifest_path("../Cargo.toml")?; // We will lint `./cargo-scout` and `./cargo-scout-lib`. assert_eq!(vec!["cargo-scout".to_string(), "cargo-scout-lib".to_string()], config.members());
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for CargoConfig
impl Send for CargoConfig
impl Sync for CargoConfig
impl Unpin for CargoConfig
impl UnwindSafe for CargoConfig
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,