@@ -38,34 +38,16 @@ mod ffi {
3838 unsafe extern "C++" {
3939 include ! ( "libnixstore/include/nix.h" ) ;
4040
41- // bindings that are also available in the perl bindings
4241 fn init ( ) ;
4342 fn is_valid_path ( path : & str ) -> Result < bool > ;
4443 fn query_path_hash ( path : & str ) -> Result < String > ;
45- fn query_deriver ( path : & str ) -> Result < String > ;
4644 fn query_path_info ( path : & str , base32 : bool ) -> Result < InternalPathInfo > ;
47- fn query_raw_realisation ( output_id : & str ) -> Result < String > ;
4845 fn query_path_from_hash_part ( hash_part : & str ) -> Result < String > ;
49- fn compute_fs_closure (
50- flip_direction : bool ,
51- include_outputs : bool ,
52- paths : Vec < & str > ,
53- ) -> Result < Vec < String > > ;
54- fn topo_sort_paths ( paths : Vec < & str > ) -> Result < Vec < String > > ;
55- fn follow_links_to_store_path ( path : & str ) -> Result < String > ;
56- fn export_paths ( fd : i32 , paths : Vec < & str > ) -> Result < ( ) > ;
57- fn import_paths ( fd : i32 , dont_check_signs : bool ) -> Result < ( ) > ;
58- fn hash_file ( algo : & str , base32 : bool , path : & str ) -> Result < String > ;
59- fn hash_string ( algo : & str , base32 : bool , s : & str ) -> Result < String > ;
6046 fn convert_hash ( algo : & str , s : & str , to_base_32 : bool ) -> Result < String > ;
6147 fn sign_string ( secret_key : & str , msg : & str ) -> Result < String > ;
6248 fn check_signature ( public_key : & str , sig : & str , msg : & str ) -> Result < bool > ;
6349 fn derivation_from_path ( drv_path : & str ) -> Result < InternalDrv > ;
64- fn add_temp_root ( store_path : & str ) -> Result < ( ) > ;
65- fn get_bin_dir ( ) -> String ;
6650 fn get_store_dir ( ) -> String ;
67-
68- // additional but useful for harmonia
6951 fn get_build_log ( derivation_path : & str ) -> Result < String > ;
7052 fn get_nar_list ( store_path : & str ) -> Result < String > ;
7153 }
@@ -157,16 +139,6 @@ pub fn query_path_hash(path: &str) -> Result<String, cxx::Exception> {
157139 ffi:: query_path_hash ( path)
158140}
159141
160- #[ inline]
161- #[ must_use]
162- /// Return deriver of a valid path. It is permitted to omit the name part of the store path.
163- pub fn query_deriver ( path : & str ) -> Option < String > {
164- match ffi:: query_deriver ( path) {
165- Ok ( v) => string_to_opt ( v) ,
166- Err ( _) => None ,
167- }
168- }
169-
170142#[ inline]
171143/// Query information about a valid path. It is permitted to omit the name part of the store path.
172144/// The `radix` field affects only the `narHash` field of the result.
@@ -183,16 +155,6 @@ pub fn query_path_info(path: &str, radix: Radix) -> Result<PathInfo, cxx::Except
183155 } )
184156}
185157
186- #[ inline]
187- #[ must_use]
188- /// Query the information about a realisation
189- pub fn query_raw_realisation ( output_id : & str ) -> Option < String > {
190- match ffi:: query_raw_realisation ( output_id) {
191- Ok ( v) => string_to_opt ( v) ,
192- Err ( _) => None ,
193- }
194- }
195-
196158#[ inline]
197159#[ must_use]
198160/// Query the full store path given the hash part of a valid store path, or empty if the path
@@ -204,61 +166,6 @@ pub fn query_path_from_hash_part(hash_part: &str) -> Option<String> {
204166 }
205167}
206168
207- #[ inline]
208- /// Returns all store paths in the file system closure of `storePath`
209- ///
210- /// That is, all paths than can be directly or indirectly reached from it. If `flip_direction` is
211- /// true, the set of paths that can reach `storePath` is returned; that is, the closures under the
212- /// `referrers` relation instead of the `references` relation is returned. If `include_outputs` is
213- /// `true` then closure will additionally include all outputs of every derivation in the closure.
214- pub fn compute_fs_closure (
215- flip_direction : bool ,
216- include_outputs : bool ,
217- paths : Vec < & str > ,
218- ) -> Result < Vec < String > , cxx:: Exception > {
219- ffi:: compute_fs_closure ( flip_direction, include_outputs, paths)
220- }
221-
222- #[ inline]
223- /// Sort a set of paths topologically under the references relation. If `p` refers to `q`, then `p`
224- /// precedes `q` in this list.
225- pub fn topo_sort_paths ( paths : Vec < & str > ) -> Result < Vec < String > , cxx:: Exception > {
226- ffi:: topo_sort_paths ( paths)
227- }
228-
229- #[ inline]
230- /// Follow symlinks until we end up with a path in the Nix store. Will transform the results to
231- /// store paths.
232- pub fn follow_links_to_store_path ( path : & str ) -> Result < String , cxx:: Exception > {
233- ffi:: follow_links_to_store_path ( path)
234- }
235-
236- #[ inline]
237- /// Export multiple paths in the format expected by `nix-store --import`.
238- pub fn export_paths ( fd : i32 , paths : Vec < & str > ) -> Result < ( ) , cxx:: Exception > {
239- ffi:: export_paths ( fd, paths)
240- }
241-
242- #[ inline]
243- /// Import a sequence of NAR dumps created by `export_paths()` into the Nix store. Optionally, the
244- /// contents of the NARs are preloaded into the specified FS accessor to speed up subsequent
245- /// access.
246- pub fn import_paths ( fd : i32 , dont_check_signs : bool ) -> Result < ( ) , cxx:: Exception > {
247- ffi:: import_paths ( fd, dont_check_signs)
248- }
249-
250- #[ inline]
251- /// Compute the hash of the given file.
252- pub fn hash_file ( algo : & str , radix : Radix , path : & str ) -> Result < String , cxx:: Exception > {
253- ffi:: hash_file ( algo, matches ! ( radix, Radix :: Base32 ) , path)
254- }
255-
256- #[ inline]
257- /// Compute the hash of the given string.
258- pub fn hash_string ( algo : & str , radix : Radix , s : & str ) -> Result < String , cxx:: Exception > {
259- ffi:: hash_string ( algo, matches ! ( radix, Radix :: Base32 ) , s)
260- }
261-
262169#[ inline]
263170/// Parse the hash from a string representation in the format `[<type>:]<base16|base32|base64>` or
264171/// `<type>-<base64>` to a string representation of the hash, in `base-16`, `base-32`. The result
@@ -304,20 +211,6 @@ pub fn derivation_from_path(drv_path: &str) -> Result<Drv, cxx::Exception> {
304211 } )
305212}
306213
307- #[ inline]
308- /// Add a store path as a temporary root of the garbage collector. The root disappears as soon as
309- /// we exit.
310- pub fn add_temp_root ( store_path : & str ) -> Result < ( ) , cxx:: Exception > {
311- ffi:: add_temp_root ( store_path)
312- }
313-
314- #[ inline]
315- #[ must_use]
316- /// Return the path to the directory where the main programs are stored.
317- pub fn get_bin_dir ( ) -> String {
318- ffi:: get_bin_dir ( )
319- }
320-
321214#[ inline]
322215#[ must_use]
323216/// Returns the path to the directory where nix store sources and derived files.
0 commit comments