[][src]Struct cargo_scout_lib::config::rust::CargoConfig

pub struct CargoConfig { /* fields omitted */ }

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

impl Config for CargoConfig[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.