Trait nix_daemon::Store
source · pub trait Store {
type Error: From<Error> + Send + Sync;
Show 16 methods
// Required methods
fn is_valid_path<P: AsRef<str> + Send + Sync + Debug>(
&mut self,
path: P,
) -> impl Future<Output = Result<impl Progress<T = bool, Error = Self::Error>, Self::Error>> + Send;
fn has_substitutes<P: AsRef<str> + Send + Sync + Debug>(
&mut self,
path: P,
) -> impl Future<Output = Result<impl Progress<T = bool, Error = Self::Error>, Self::Error>> + Send;
fn add_to_store<SN: AsRef<str> + Send + Sync + Debug, SC: AsRef<str> + Send + Sync + Debug, Refs, R>(
&mut self,
name: SN,
cam_str: SC,
refs: Refs,
repair: bool,
source: R,
) -> impl Future<Output = Result<impl Progress<T = (String, PathInfo), Error = Self::Error>, Self::Error>> + Send
where Refs: IntoIterator + Send + Debug,
Refs::IntoIter: ExactSizeIterator + Send,
Refs::Item: AsRef<str> + Send + Sync,
R: AsyncReadExt + Unpin + Send + Debug;
fn build_paths<Paths>(
&mut self,
paths: Paths,
mode: BuildMode,
) -> impl Future<Output = Result<impl Progress<T = (), Error = Self::Error>, Self::Error>> + Send
where Paths: IntoIterator + Send + Debug,
Paths::IntoIter: ExactSizeIterator + Send,
Paths::Item: AsRef<str> + Send + Sync;
fn ensure_path<Path: AsRef<str> + Send + Sync + Debug>(
&mut self,
path: Path,
) -> impl Future<Output = Result<impl Progress<T = (), Error = Self::Error>, Self::Error>> + Send;
fn add_temp_root<Path: AsRef<str> + Send + Sync + Debug>(
&mut self,
path: Path,
) -> impl Future<Output = Result<impl Progress<T = (), Error = Self::Error>, Self::Error>> + Send;
fn add_indirect_root<Path: AsRef<str> + Send + Sync + Debug>(
&mut self,
path: Path,
) -> impl Future<Output = Result<impl Progress<T = (), Error = Self::Error>, Self::Error>> + Send;
fn find_roots(
&mut self,
) -> impl Future<Output = Result<impl Progress<T = HashMap<String, String>, Error = Self::Error>, Self::Error>> + Send;
fn set_options(
&mut self,
opts: ClientSettings,
) -> impl Future<Output = Result<impl Progress<T = (), Error = Self::Error>, Self::Error>> + Send;
fn query_pathinfo<S: AsRef<str> + Send + Sync + Debug>(
&mut self,
path: S,
) -> impl Future<Output = Result<impl Progress<T = Option<PathInfo>, Error = Self::Error>, Self::Error>> + Send;
fn query_valid_paths<Paths>(
&mut self,
paths: Paths,
use_substituters: bool,
) -> impl Future<Output = Result<impl Progress<T = Vec<String>, Error = Self::Error>, Self::Error>> + Send
where Paths: IntoIterator + Send + Debug,
Paths::IntoIter: ExactSizeIterator + Send,
Paths::Item: AsRef<str> + Send + Sync;
fn query_substitutable_paths<Paths>(
&mut self,
paths: Paths,
) -> impl Future<Output = Result<impl Progress<T = Vec<String>, Error = Self::Error>, Self::Error>> + Send
where Paths: IntoIterator + Send + Debug,
Paths::IntoIter: ExactSizeIterator + Send,
Paths::Item: AsRef<str> + Send + Sync;
fn query_valid_derivers<S: AsRef<str> + Send + Sync + Debug>(
&mut self,
path: S,
) -> impl Future<Output = Result<impl Progress<T = Vec<String>, Error = Self::Error>, Self::Error>> + Send;
fn query_missing<Ps>(
&mut self,
paths: Ps,
) -> impl Future<Output = Result<impl Progress<T = Missing, Error = Self::Error>, Self::Error>> + Send
where Ps: IntoIterator + Send + Debug,
Ps::IntoIter: ExactSizeIterator + Send,
Ps::Item: AsRef<str> + Send + Sync;
fn query_derivation_output_map<P: AsRef<str> + Send + Sync + Debug>(
&mut self,
path: P,
) -> impl Future<Output = Result<impl Progress<T = HashMap<String, String>, Error = Self::Error>, Self::Error>> + Send;
fn build_paths_with_results<Ps>(
&mut self,
paths: Ps,
mode: BuildMode,
) -> impl Future<Output = Result<impl Progress<T = HashMap<String, BuildResult>, Error = Self::Error>, Self::Error>> + Send
where Ps: IntoIterator + Send + Debug,
Ps::IntoIter: ExactSizeIterator + Send,
Ps::Item: AsRef<str> + Send + Sync;
}
Expand description
Generic interface to a Nix store.
See nix::DaemonStore
for an implementation that talks to a CppNix (compatible) daemon.
Required Associated Types§
Required Methods§
sourcefn is_valid_path<P: AsRef<str> + Send + Sync + Debug>(
&mut self,
path: P,
) -> impl Future<Output = Result<impl Progress<T = bool, Error = Self::Error>, Self::Error>> + Send
fn is_valid_path<P: AsRef<str> + Send + Sync + Debug>( &mut self, path: P, ) -> impl Future<Output = Result<impl Progress<T = bool, Error = Self::Error>, Self::Error>> + Send
Returns whether a store path is valid.
sourcefn has_substitutes<P: AsRef<str> + Send + Sync + Debug>(
&mut self,
path: P,
) -> impl Future<Output = Result<impl Progress<T = bool, Error = Self::Error>, Self::Error>> + Send
fn has_substitutes<P: AsRef<str> + Send + Sync + Debug>( &mut self, path: P, ) -> impl Future<Output = Result<impl Progress<T = bool, Error = Self::Error>, Self::Error>> + Send
Returns whether Self::query_substitutable_paths()
would return anything.
sourcefn add_to_store<SN: AsRef<str> + Send + Sync + Debug, SC: AsRef<str> + Send + Sync + Debug, Refs, R>(
&mut self,
name: SN,
cam_str: SC,
refs: Refs,
repair: bool,
source: R,
) -> impl Future<Output = Result<impl Progress<T = (String, PathInfo), Error = Self::Error>, Self::Error>> + Sendwhere
Refs: IntoIterator + Send + Debug,
Refs::IntoIter: ExactSizeIterator + Send,
Refs::Item: AsRef<str> + Send + Sync,
R: AsyncReadExt + Unpin + Send + Debug,
fn add_to_store<SN: AsRef<str> + Send + Sync + Debug, SC: AsRef<str> + Send + Sync + Debug, Refs, R>(
&mut self,
name: SN,
cam_str: SC,
refs: Refs,
repair: bool,
source: R,
) -> impl Future<Output = Result<impl Progress<T = (String, PathInfo), Error = Self::Error>, Self::Error>> + Sendwhere
Refs: IntoIterator + Send + Debug,
Refs::IntoIter: ExactSizeIterator + Send,
Refs::Item: AsRef<str> + Send + Sync,
R: AsyncReadExt + Unpin + Send + Debug,
Adds a file to the store.
sourcefn build_paths<Paths>(
&mut self,
paths: Paths,
mode: BuildMode,
) -> impl Future<Output = Result<impl Progress<T = (), Error = Self::Error>, Self::Error>> + Send
fn build_paths<Paths>( &mut self, paths: Paths, mode: BuildMode, ) -> impl Future<Output = Result<impl Progress<T = (), Error = Self::Error>, Self::Error>> + Send
Builds the specified paths.
sourcefn ensure_path<Path: AsRef<str> + Send + Sync + Debug>(
&mut self,
path: Path,
) -> impl Future<Output = Result<impl Progress<T = (), Error = Self::Error>, Self::Error>> + Send
fn ensure_path<Path: AsRef<str> + Send + Sync + Debug>( &mut self, path: Path, ) -> impl Future<Output = Result<impl Progress<T = (), Error = Self::Error>, Self::Error>> + Send
Ensure the specified store path exists.
sourcefn add_temp_root<Path: AsRef<str> + Send + Sync + Debug>(
&mut self,
path: Path,
) -> impl Future<Output = Result<impl Progress<T = (), Error = Self::Error>, Self::Error>> + Send
fn add_temp_root<Path: AsRef<str> + Send + Sync + Debug>( &mut self, path: Path, ) -> impl Future<Output = Result<impl Progress<T = (), Error = Self::Error>, Self::Error>> + Send
Creates a temporary GC root, which persists until the client disconnects.
sourcefn add_indirect_root<Path: AsRef<str> + Send + Sync + Debug>(
&mut self,
path: Path,
) -> impl Future<Output = Result<impl Progress<T = (), Error = Self::Error>, Self::Error>> + Send
fn add_indirect_root<Path: AsRef<str> + Send + Sync + Debug>( &mut self, path: Path, ) -> impl Future<Output = Result<impl Progress<T = (), Error = Self::Error>, Self::Error>> + Send
Creates a persistent GC root. This is what’s normally meant by a GC root.
sourcefn find_roots(
&mut self,
) -> impl Future<Output = Result<impl Progress<T = HashMap<String, String>, Error = Self::Error>, Self::Error>> + Send
fn find_roots( &mut self, ) -> impl Future<Output = Result<impl Progress<T = HashMap<String, String>, Error = Self::Error>, Self::Error>> + Send
Returns the (link, target)
of all known GC roots.
sourcefn set_options(
&mut self,
opts: ClientSettings,
) -> impl Future<Output = Result<impl Progress<T = (), Error = Self::Error>, Self::Error>> + Send
fn set_options( &mut self, opts: ClientSettings, ) -> impl Future<Output = Result<impl Progress<T = (), Error = Self::Error>, Self::Error>> + Send
Applies client options. This changes the behaviour of future commands.
sourcefn query_pathinfo<S: AsRef<str> + Send + Sync + Debug>(
&mut self,
path: S,
) -> impl Future<Output = Result<impl Progress<T = Option<PathInfo>, Error = Self::Error>, Self::Error>> + Send
fn query_pathinfo<S: AsRef<str> + Send + Sync + Debug>( &mut self, path: S, ) -> impl Future<Output = Result<impl Progress<T = Option<PathInfo>, Error = Self::Error>, Self::Error>> + Send
Returns a PathInfo
struct for the given path.
sourcefn query_valid_paths<Paths>(
&mut self,
paths: Paths,
use_substituters: bool,
) -> impl Future<Output = Result<impl Progress<T = Vec<String>, Error = Self::Error>, Self::Error>> + Send
fn query_valid_paths<Paths>( &mut self, paths: Paths, use_substituters: bool, ) -> impl Future<Output = Result<impl Progress<T = Vec<String>, Error = Self::Error>, Self::Error>> + Send
Returns which of the passed paths are valid.
sourcefn query_substitutable_paths<Paths>(
&mut self,
paths: Paths,
) -> impl Future<Output = Result<impl Progress<T = Vec<String>, Error = Self::Error>, Self::Error>> + Send
fn query_substitutable_paths<Paths>( &mut self, paths: Paths, ) -> impl Future<Output = Result<impl Progress<T = Vec<String>, Error = Self::Error>, Self::Error>> + Send
Returns paths which can be substituted.
sourcefn query_valid_derivers<S: AsRef<str> + Send + Sync + Debug>(
&mut self,
path: S,
) -> impl Future<Output = Result<impl Progress<T = Vec<String>, Error = Self::Error>, Self::Error>> + Send
fn query_valid_derivers<S: AsRef<str> + Send + Sync + Debug>( &mut self, path: S, ) -> impl Future<Output = Result<impl Progress<T = Vec<String>, Error = Self::Error>, Self::Error>> + Send
Returns a list of valid derivers for a path.
This is sort of like PathInfo::deriver
, but it doesn’t lie to you.
sourcefn query_missing<Ps>(
&mut self,
paths: Ps,
) -> impl Future<Output = Result<impl Progress<T = Missing, Error = Self::Error>, Self::Error>> + Send
fn query_missing<Ps>( &mut self, paths: Ps, ) -> impl Future<Output = Result<impl Progress<T = Missing, Error = Self::Error>, Self::Error>> + Send
Takes a list of paths and queries which would be built, substituted or unknown, along with an estimate of the cumulative download and NAR sizes.
sourcefn query_derivation_output_map<P: AsRef<str> + Send + Sync + Debug>(
&mut self,
path: P,
) -> impl Future<Output = Result<impl Progress<T = HashMap<String, String>, Error = Self::Error>, Self::Error>> + Send
fn query_derivation_output_map<P: AsRef<str> + Send + Sync + Debug>( &mut self, path: P, ) -> impl Future<Output = Result<impl Progress<T = HashMap<String, String>, Error = Self::Error>, Self::Error>> + Send
Returns a map of (output, store path)
for the given derivation.
sourcefn build_paths_with_results<Ps>(
&mut self,
paths: Ps,
mode: BuildMode,
) -> impl Future<Output = Result<impl Progress<T = HashMap<String, BuildResult>, Error = Self::Error>, Self::Error>> + Send
fn build_paths_with_results<Ps>( &mut self, paths: Ps, mode: BuildMode, ) -> impl Future<Output = Result<impl Progress<T = HashMap<String, BuildResult>, Error = Self::Error>, Self::Error>> + Send
Like Self::build_paths()
, but returns a BuildResult
for each entry in paths
.