pub struct ProjectPluginOverrides {
pub version: u32,
pub forced: ForceMap,
}Expand description
Per-project plugin override file.
A project is “the directory containing .oxicode/”. Path is supplied by
the caller (typically PackageManager::project_dir); the file itself
is optional — missing-file is the no-overrides case.
Fields§
§version: u32Schema version.
forced: ForceMapPer-package, per-kind force map.
Implementations§
Source§impl ProjectPluginOverrides
impl ProjectPluginOverrides
Sourcepub fn project_path(project_dir: &Path) -> PathBuf
pub fn project_path(project_dir: &Path) -> PathBuf
Canonical path: <project_dir>/.oxicode/<OVERRIDES_FILE>.
Sourcepub fn read(path: &Path) -> Result<Self>
pub fn read(path: &Path) -> Result<Self>
Strict read — missing file is Ok(Empty), corrupt file is an
error so Doctor can surface it (callers wanting best-effort use
read_or_default).
Sourcepub fn read_or_default(path: &Path) -> Self
pub fn read_or_default(path: &Path) -> Self
Lenient read: missing or corrupt -> empty overrides. Doctor is the structured channel for surfacing corruption.
Sourcepub fn write(&self, path: &Path) -> Result<()>
pub fn write(&self, path: &Path) -> Result<()>
Atomic write matching the RuntimeConfig::write policy.
Sourcepub fn entry_count(&self) -> usize
pub fn entry_count(&self) -> usize
Number of (package, kind) override entries.
Sourcepub fn forced_state(
&self,
package: &str,
kind: ResourceKind,
) -> Option<ForceState>
pub fn forced_state( &self, package: &str, kind: ResourceKind, ) -> Option<ForceState>
The forced state for (package, kind), if any.
Sourcepub fn force_on(&mut self, package: impl Into<String>, kind: ResourceKind)
pub fn force_on(&mut self, package: impl Into<String>, kind: ResourceKind)
Force a kind on under a package (project layer can rescue a resource the user disabled globally).
Sourcepub fn force_off(&mut self, package: impl Into<String>, kind: ResourceKind)
pub fn force_off(&mut self, package: impl Into<String>, kind: ResourceKind)
Force a kind off under a package.
Sourcepub fn clear(&mut self, package: &str, kind: ResourceKind)
pub fn clear(&mut self, package: &str, kind: ResourceKind)
Drop the override for (package, kind). Keys with empty inner
maps are also removed so the persisted file stays minimal.
Trait Implementations§
Source§impl Clone for ProjectPluginOverrides
impl Clone for ProjectPluginOverrides
Source§fn clone(&self) -> ProjectPluginOverrides
fn clone(&self) -> ProjectPluginOverrides
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ProjectPluginOverrides
impl Debug for ProjectPluginOverrides
Source§impl Default for ProjectPluginOverrides
impl Default for ProjectPluginOverrides
Source§fn default() -> ProjectPluginOverrides
fn default() -> ProjectPluginOverrides
Source§impl<'de> Deserialize<'de> for ProjectPluginOverrides
impl<'de> Deserialize<'de> for ProjectPluginOverrides
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for ProjectPluginOverrides
impl RefUnwindSafe for ProjectPluginOverrides
impl Send for ProjectPluginOverrides
impl Sync for ProjectPluginOverrides
impl Unpin for ProjectPluginOverrides
impl UnsafeUnpin for ProjectPluginOverrides
impl UnwindSafe for ProjectPluginOverrides
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
Source§fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
self file descriptor.Source§fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
Source§fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: Sized + AsFilelike,
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: Sized + AsFilelike,
self file descriptor. Read moreSource§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> ⓘ
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> ⓘ
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