pub enum Fetch {
URL {
url: Url,
exp_hash: Option<NixHash>,
},
Tarball {
url: Url,
exp_nar_sha256: Option<[u8; 32]>,
},
NAR {
url: Url,
hash: NixHash,
},
Executable {
url: Url,
hash: NixHash,
},
Git(),
}
Expand description
Representing options for doing a fetch.
Variants§
URL
Fetch a literal file from the given URL, with an optional expected hash.
Tarball
Fetch a tarball from the given URL and unpack. The file must be a tape archive (.tar), optionally compressed with gzip, bzip2 or xz. The top-level path component of the files in the tarball is removed, so it is best if the tarball contains a single directory at top level. Optionally, a sha256 digest can be provided to verify the unpacked contents against.
Fields
NAR
Fetch a NAR file from the given URL and unpack. The file can optionally be compressed.
Fields
Executable
Fetches a file at a URL, makes it the store path root node,
but executable.
Used by <nix/fetchurl.nix>, with executable = true;
.
The expected hash is over the NAR representation, but can be not SHA256:
(import <nix/fetchurl.nix> { url = "https://cache.nixos.org/nar/0r8nqa1klm5v17ifc6z96m9wywxkjvgbnqq9pmy0sgqj53wj3n12.nar.xz"; hash = "sha1-NKNeU1csW5YJ4lCeWH3Z/apppNU="; executable = true; })
Fields
Git()
TODO
Implementations§
source§impl Fetch
impl Fetch
sourcepub fn store_path<'a>(
&self,
name: &'a str,
) -> Result<Option<StorePathRef<'a>>, BuildStorePathError>
pub fn store_path<'a>( &self, name: &'a str, ) -> Result<Option<StorePathRef<'a>>, BuildStorePathError>
If the Fetch contains an expected hash upfront, returns the resulting store path. This doesn’t do any fetching.
Trait Implementations§
source§impl PartialEq for Fetch
impl PartialEq for Fetch
impl Eq for Fetch
impl StructuralPartialEq for Fetch
Auto Trait Implementations§
impl Freeze for Fetch
impl RefUnwindSafe for Fetch
impl Send for Fetch
impl Sync for Fetch
impl Unpin for Fetch
impl UnwindSafe for Fetch
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<T> FutureExt for T
impl<T> FutureExt for T
source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
source§impl<T> FutureExt for T
impl<T> FutureExt for T
source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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>
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 moresource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request