Skip to main content

cargo_msrv/compatibility/
mod.rs

1use crate::rust::Toolchain;
2
3mod rustup_toolchain_check;
4#[cfg(test)]
5mod testing;
6
7use crate::{Compatibility, TResult};
8pub use rustup_toolchain_check::{RunCommand, RustupToolchainCheck};
9
10#[cfg(test)]
11pub use testing::TestRunner;
12
13/// Implementers of this trait must determine whether a Rust toolchain is _supported_
14/// for a Rust project. This is a step in the process of determining the _minimally
15/// supported_ Rust version; the MSRV.
16pub trait IsCompatible {
17    fn before(&self, _toolchain: &Toolchain) -> TResult<()> {
18        Ok(())
19    }
20
21    fn is_compatible(&self, toolchain: &Toolchain) -> TResult<Compatibility>;
22
23    fn after(&self, _toolchain: &Toolchain) -> TResult<()> {
24        Ok(())
25    }
26}