docs(nix-compat): fix some docstring references

Change-Id: Ic1b3148f549d8d41a00b5a17f360cc7074fe30ae
Reviewed-on: https://cl.tvl.fyi/c/depot/+/13248
Tested-by: BuildkiteCI
Autosubmit: flokli <flokli@flokli.de>
Reviewed-by: Domen Kožar <domen@cachix.org>
Reviewed-by: Marijan Petričević <marijan.petricevic94@gmail.com>
This commit is contained in:
Florian Klink 2025-03-13 07:03:07 +01:00 committed by clbot
parent a0b6fad637
commit 29e4b3210b
4 changed files with 14 additions and 12 deletions

View file

@ -192,8 +192,8 @@ impl Derivation {
/// the A-Term.
///
/// It's up to the caller of this function to provide a (infallible) lookup
/// function to query [hash_derivation_modulo] of direct input derivations,
/// by their [StorePathRef].
/// function to query the [Derivation::hash_derivation_modulo] of direct
/// input derivations, by their [StorePathRef].
/// It will only be called in case the derivation is not a fixed-output
/// derivation.
pub fn hash_derivation_modulo<F>(&self, fn_lookup_hash_derivation_modulo: F) -> [u8; 32]
@ -230,13 +230,13 @@ impl Derivation {
/// and self.environment[$outputName] needs to be an empty string.
///
/// Output path calculation requires knowledge of the
/// [hash_derivation_modulo], which (in case of non-fixed-output
/// derivations) also requires knowledge of the [hash_derivation_modulo] of
/// input derivations (recursively).
/// [Derivation::hash_derivation_modulo], which (in case of non-fixed-output
/// derivations) also requires knowledge of the
/// [Derivation::hash_derivation_modulo] of input derivations (recursively).
///
/// To avoid recursing and doing unnecessary calculation, we simply
/// ask the caller of this function to provide the result of the
/// [hash_derivation_modulo] call of the current [Derivation],
/// [Derivation::hash_derivation_modulo] call of the current [Derivation],
/// and leave it up to them to calculate it when needed.
///
/// On completion, `self.environment[$outputName]` and

View file

@ -30,8 +30,9 @@ use crate::{nix_daemon::types::NixError, worker_protocol::STDERR_ERROR};
/// As part of its [`initialization`] it performs the handshake with the client
/// and determines the [ProtocolVersion] and [ClientSettings] to use for the remainder of the session.
///
/// Once initialized, [`handle_client`] needs to be called to handle the rest of the session,
/// it delegates all operation handling to an instance of [NixDaemonIO].
/// Once initialized, [NixDaemon::handle_client] needs to be called to handle
/// the rest of the session, it delegates all operation handling to an instance
/// of [NixDaemonIO].
///
/// [`initialization`]: NixDaemon::initialize
#[allow(dead_code)]

View file

@ -172,7 +172,7 @@ where
}
}
/// Decompose a string into a [StorePath] and a [PathBuf] containing the
/// Decompose a string into a [StorePath] and a [Path] containing the
/// rest of the path, or an error.
#[cfg(target_family = "unix")]
pub fn from_absolute_path_full<'a, P>(path: &'a P) -> Result<(Self, &'a Path), Error>

View file

@ -3,9 +3,10 @@ static DEFAULT_PROTOCOL_VERSION: ProtocolVersion = ProtocolVersion::from_parts(1
/// Protocol versions are represented as a u16.
/// The upper 8 bits are the major version, the lower bits the minor.
/// This is not aware of any endianness, use [crate::wire::read_u64] to get an
/// u64 first, and the try_from() impl from here if you're receiving over the
/// Nix Worker protocol.
/// This is not aware of any endianness.
/// If you're receiving over the Nix worker protocol, you need to read a
/// little-endian encoded u64, and then use the try_from() impl to convert to this
/// type.
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub struct ProtocolVersion(u16);