Struct nix_cache_watcher::nix::StoreState
source · [−]pub struct StoreState { /* private fields */ }Expand description
The state of the Nix store at a given point in time
Implementations
sourceimpl StoreState
impl StoreState
sourcepub fn new(config: NixConfiguration) -> Self
pub fn new(config: NixConfiguration) -> Self
Create a new, empty, StoreState with the specified Nix configuration
sourcepub fn add_path(&mut self, path: impl AsRef<Path>) -> Result<(), StoreError>
pub fn add_path(&mut self, path: impl AsRef<Path>) -> Result<(), StoreError>
Add a path to the StoreState
Errors
Will propagate an error if the prefix is impossible to strip due to misconfiguration
sourcepub fn paths(&self) -> impl Iterator<Item = PathBuf> + '_
pub fn paths(&self) -> impl Iterator<Item = PathBuf> + '_
Iterator over the paths in this StoreState
sourcepub fn diff(&self, other: &StoreState) -> Result<Self, StoreError>
pub fn diff(&self, other: &StoreState) -> Result<Self, StoreError>
Return all paths that are different between this StoreState and another StoreState
This returns elements that are in other, but not in self
Errors
Will return an error if two stores with incompatible configuration are compared.
sourcepub fn path_count(&self) -> usize
pub fn path_count(&self) -> usize
Returns the number of unique paths in the store
sourcepub fn from_store_including(
configuration: &NixConfiguration,
includes: &[Regex]
) -> Result<Self, StoreError>
pub fn from_store_including(
configuration: &NixConfiguration,
includes: &[Regex]
) -> Result<Self, StoreError>
Create a StoreState from the current status of the Nix store pointed to by the given
NixConfiguration including installables as well as other paths matching the supplied
regexes
Errors
Will propagate any IO errors that occur trying to enumerate the Nix store
sourcepub fn from_store(configuration: &NixConfiguration) -> Result<Self, StoreError>
pub fn from_store(configuration: &NixConfiguration) -> Result<Self, StoreError>
Create a StoreState from the current status of the Nix store pointed to by the given
NixConfiguration
This is a wrapper around from_store_including with the
default include filters implied.
The default filters will include:
- Any installable (non-disableable)
- Any
nix-shellderivations
Errors
Will propagate any IO errors that occur trying to enumerate the Nix store
sourcepub async fn filter_against_cache(
self,
cache_uri: &str
) -> Result<Self, StoreError>
pub async fn filter_against_cache(
self,
cache_uri: &str
) -> Result<Self, StoreError>
Filter this Store state against the given nix binary cache, removing any paths that are
present in the cache. The provided cache uri is expected not to have a trailing slash
Errors
Will propagate any network or nix store interaction errors that occur
Trait Implementations
sourceimpl Clone for StoreState
impl Clone for StoreState
sourcefn clone(&self) -> StoreState
fn clone(&self) -> StoreState
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for StoreState
impl Debug for StoreState
sourceimpl Decode for StoreState
impl Decode for StoreState
sourceimpl Default for StoreState
impl Default for StoreState
sourcefn default() -> StoreState
fn default() -> StoreState
Returns the “default value” for a type. Read more
sourceimpl Encode for StoreState
impl Encode for StoreState
sourceimpl PartialEq<StoreState> for StoreState
impl PartialEq<StoreState> for StoreState
sourcefn eq(&self, other: &StoreState) -> bool
fn eq(&self, other: &StoreState) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
impl Eq for StoreState
impl StructuralEq for StoreState
impl StructuralPartialEq for StoreState
Auto Trait Implementations
impl RefUnwindSafe for StoreState
impl Send for StoreState
impl Sync for StoreState
impl Unpin for StoreState
impl UnwindSafe for StoreState
Blanket Implementations
sourceimpl<'de, T> BorrowDecode<'de> for Twhere
T: Decode,
impl<'de, T> BorrowDecode<'de> for Twhere
T: Decode,
sourcefn borrow_decode<D>(decoder: &mut D) -> Result<T, DecodeError>where
D: Decoder,
fn borrow_decode<D>(decoder: &mut D) -> Result<T, DecodeError>where
D: Decoder,
Attempt to decode this type with the given BorrowDecode.
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key and return true if they are equal.
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Instruments this type with the provided Span, returning an
Instrumented wrapper. Read more
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for Twhere
V: MultiLane<T>,
impl<V, T> VZip<V> for Twhere
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more