pub struct RealEnv { /* private fields */ }Expand description
Production environment implementation.
This is the default environment used in production, providing real implementations of all I/O traits.
§Example
use debtmap::env::RealEnv;
use debtmap::config::DebtmapConfig;
let config = DebtmapConfig::default();
let env = RealEnv::new(config);
// Now use env with Effect typesImplementations§
Source§impl RealEnv
impl RealEnv
Sourcepub fn new(config: DebtmapConfig) -> Self
pub fn new(config: DebtmapConfig) -> Self
Create a new production environment with the given configuration.
This sets up:
- Real file system access
- Real coverage loader (LCOV, etc.)
- In-memory cache (for analysis results)
Sourcepub fn without_cache(config: DebtmapConfig) -> Self
pub fn without_cache(config: DebtmapConfig) -> Self
Create an environment with no caching.
Useful for one-shot analysis where caching overhead isn’t worth it.
Sourcepub fn custom(
file_system: Arc<dyn FileSystem>,
coverage_loader: Arc<dyn CoverageLoader>,
cache: Arc<dyn Cache>,
config: DebtmapConfig,
) -> Self
pub fn custom( file_system: Arc<dyn FileSystem>, coverage_loader: Arc<dyn CoverageLoader>, cache: Arc<dyn Cache>, config: DebtmapConfig, ) -> Self
Create an environment with custom implementations.
This is useful for advanced use cases where you need to customize specific components while keeping others at their defaults.
Sourcepub fn with_config(self, config: DebtmapConfig) -> Self
pub fn with_config(self, config: DebtmapConfig) -> Self
Update the configuration.
Returns a new environment with the updated config (immutable pattern).
Trait Implementations§
Source§impl AnalysisEnv for RealEnv
impl AnalysisEnv for RealEnv
Source§fn file_system(&self) -> &dyn FileSystem
fn file_system(&self) -> &dyn FileSystem
Access file system operations. Read more
Source§fn coverage_loader(&self) -> &dyn CoverageLoader
fn coverage_loader(&self) -> &dyn CoverageLoader
Access coverage data loading. Read more
Source§fn config(&self) -> &DebtmapConfig
fn config(&self) -> &DebtmapConfig
Access the debtmap configuration. Read more
Source§fn with_config(self, config: DebtmapConfig) -> Self
fn with_config(self, config: DebtmapConfig) -> Self
Create a new environment with the updated config. Read more
Auto Trait Implementations§
impl Freeze for RealEnv
impl !RefUnwindSafe for RealEnv
impl Send for RealEnv
impl Sync for RealEnv
impl Unpin for RealEnv
impl !UnwindSafe for RealEnv
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more