pub struct AppState {
pub flake_text: String,
pub flake_path: PathBuf,
pub lock_file: Option<PathBuf>,
pub diff: bool,
pub no_lock: bool,
pub interactive: bool,
pub no_cache: bool,
pub cache_path: Option<PathBuf>,
pub config: Config,
}Expand description
Application state for a flake-edit session.
Holds the flake content, file paths, and configuration options.
Fields§
§flake_text: StringContent of the flake.nix file
flake_path: PathBufPath to the flake.nix file
lock_file: Option<PathBuf>Path to the flake.lock file (if specified)
diff: boolOnly show diff, don’t write changes
no_lock: boolSkip running nix flake lock after changes
interactive: boolAllow interactive TUI prompts
no_cache: boolDisable reading from and writing to the completion cache
cache_path: Option<PathBuf>Custom cache file path (for testing or portable configs)
config: ConfigLoaded configuration
Implementations§
Source§impl AppState
impl AppState
pub fn new( flake_text: String, flake_path: PathBuf, config_path: Option<PathBuf>, ) -> Result<Self, ConfigError>
pub fn with_diff(self, diff: bool) -> Self
pub fn with_no_lock(self, no_lock: bool) -> Self
pub fn with_interactive(self, interactive: bool) -> Self
pub fn with_lock_file(self, lock_file: Option<PathBuf>) -> Self
pub fn with_no_cache(self, no_cache: bool) -> Self
pub fn with_cache_path(self, cache_path: Option<PathBuf>) -> Self
Sourcepub fn cache_config(&self) -> CacheConfig
pub fn cache_config(&self) -> CacheConfig
Get the cache configuration based on CLI flags.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AppState
impl RefUnwindSafe for AppState
impl Send for AppState
impl Sync for AppState
impl Unpin for AppState
impl UnwindSafe for AppState
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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