Skip to main content

LocationParameters

Struct LocationParameters 

Source
#[non_exhaustive]
pub struct LocationParameters { pub submodules: Option<bool>, pub shallow: Option<bool>, pub lfs: Option<bool>, pub export_ignore: Option<bool>, pub all_refs: Option<bool>, pub verify_commit: Option<bool>, pub keytype: Option<String>, pub public_key: Option<String>, pub public_keys: Option<String>, /* private fields */ }
Expand description

Query-string parameters that decorate a FlakeRef.

Notably absent: ref and rev. Those are typed slots on the FlakeRef’s kind (crate::FlakeRefType::GitForge / crate::FlakeRefType::Indirect) there is one source of truth for ref/rev, and it is not here. The parser extracts ?ref= / ?rev= values out of the query string and routes them into those typed slots, setting the kind’s RefLocation to QueryParameter so round-trip Display preserves the form.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§submodules: Option<bool>

Fetch git submodules during clone. Mirrors Nix’s git fetcher submodules setting; URL-time coercion is strict (value == "1"), so the parser accepts "1" / "0" and rejects anything else.

§shallow: Option<bool>

Use a shallow clone (skip git history). Mirrors Nix’s git fetcher shallow setting; URL-time coercion follows the same rule as Self::submodules.

§lfs: Option<bool>

Git-LFS support. Boolean values follow Nix’s URL-time coercion: "1" -> true, "0" -> false; anything else (including "true" / "false") is rejected at parse time so the diagnostic stays visible.

§export_ignore: Option<bool>

Honour .gitattributes export-ignore directives during fetch.

§all_refs: Option<bool>

Fetch all refs, not just the requested one.

§verify_commit: Option<bool>

Verify the commit signature against the configured key set.

§keytype: Option<String>

Signature key type (e.g. ssh-ed25519). Stored as a free-form string because Nix does not enumerate valid values.

§public_key: Option<String>

Public key bytes used to verify commit signatures.

§public_keys: Option<String>

Multi-key bag (Nix uses a single string with platform-specific delimiters).

Implementations§

Source§

impl LocationParameters

Source

pub fn dir(&mut self, dir: Option<String>) -> &mut Self

Chainable setter for the dir parameter; returns &mut Self so the builder form (params.dir(Some(...)).host(Some(...))) reads naturally.

Source

pub fn nar_hash(&mut self, nar_hash: Option<String>) -> &mut Self

Chainable setter for the narHash parameter. See Self::dir.

Source

pub fn host(&mut self, host: Option<String>) -> &mut Self

Chainable setter for the host parameter. See Self::dir.

Source

pub fn set_dir(&mut self, dir: Option<String>)

Replace the dir parameter (a flake’s subdirectory inside its repo).

Source

pub fn set_nar_hash(&mut self, nar_hash: Option<String>)

Replace the narHash parameter (SRI-format NAR hash).

Source

pub fn set_host(&mut self, host: Option<String>)

Replace the host parameter (used to override the default host for kinds that resolve to a forge or remote URL).

Source

pub fn rev_count_mut(&mut self) -> &mut Option<String>

Mutable handle to the revCount slot for in-place edits.

Source

pub fn set_last_modified(&mut self, last_modified: Option<String>)

Replace the lastModified parameter (Unix timestamp of the source).

Source

pub fn set_rev_count(&mut self, rev_count: Option<String>)

Replace the revCount parameter (commit count from the repo root).

Source

pub fn set_submodules(&mut self, submodules: Option<bool>)

Replace the submodules boolean parameter.

Source

pub fn set_shallow(&mut self, shallow: Option<bool>)

Replace the shallow boolean parameter.

Source

pub fn set_lfs(&mut self, lfs: Option<bool>)

Replace the lfs boolean parameter.

Source

pub fn set_export_ignore(&mut self, export_ignore: Option<bool>)

Replace the exportIgnore boolean parameter.

Source

pub fn set_all_refs(&mut self, all_refs: Option<bool>)

Replace the allRefs boolean parameter.

Source

pub fn set_verify_commit(&mut self, verify_commit: Option<bool>)

Replace the verifyCommit boolean parameter.

Source

pub fn set_keytype(&mut self, keytype: Option<String>)

Replace the keytype parameter (signature key type).

Source

pub fn set_public_key(&mut self, public_key: Option<String>)

Replace the publicKey parameter.

Source

pub fn set_public_keys(&mut self, public_keys: Option<String>)

Replace the publicKeys parameter.

Source

pub fn add_arbitrary(&mut self, arbitrary: (String, String))

Append a (key, value) pair to the unrecognised-parameter vec. Used by the parser for keys that do not match a typed slot; rendered verbatim by Display to keep round-trip parity.

Trait Implementations§

Source§

impl Clone for LocationParameters

Source§

fn clone(&self) -> LocationParameters

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for LocationParameters

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for LocationParameters

Source§

fn default() -> LocationParameters

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for LocationParameters

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for LocationParameters

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for LocationParameters

Source§

fn eq(&self, other: &LocationParameters) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for LocationParameters

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for LocationParameters

Source§

impl StructuralPartialEq for LocationParameters

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,