docs: fix broken references in rust docs
Fixes #100 Change-Id: I03e09ac3a9b964a046a7fe17d0f9c7c0bdac5c6d Reviewed-on: https://cl.snix.dev/c/snix/+/30305 Reviewed-by: Florian Klink <flokli@flokli.de> Tested-by: besadii
This commit is contained in:
parent
f31ef707f8
commit
628f91827d
18 changed files with 27 additions and 29 deletions
|
|
@ -10,7 +10,7 @@ use anyhow::{bail, Context};
|
|||
use tracing::{debug, instrument};
|
||||
|
||||
/// Produce an OCI bundle in a given path.
|
||||
/// Check [make_spec] for a description about the paths produced.
|
||||
/// Check [super::spec::make_spec] for a description about the paths produced.
|
||||
#[instrument(err)]
|
||||
pub(crate) fn make_bundle<'a>(
|
||||
request: &BuildRequest,
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ use super::scratch_name;
|
|||
/// While there's no IO occuring in this function, the generated spec contains
|
||||
/// path references relative to the "bundle location".
|
||||
/// Due to overlayfs requiring its layers to be absolute paths, we also need a
|
||||
/// [bundle_dir] parameter, pointing to the location of the bundle dir itself.
|
||||
/// bundle_dir parameter, pointing to the location of the bundle dir itself.
|
||||
///
|
||||
/// The paths used in the spec are the following (relative to a "bundle root"):
|
||||
///
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ where
|
|||
/// Holds a list of blake3 digest for individual chunks (and their sizes).
|
||||
/// Is able to construct a Reader that seeked to a certain offset, which
|
||||
/// is useful to construct a BlobReader (that implements AsyncSeek).
|
||||
/// - the current chunk index, and a Custor<Vec<u8>> holding the data of that chunk.
|
||||
/// - the current chunk index, and a `Custor<Vec<u8>>` holding the data of that chunk.
|
||||
struct ChunkedBlob<BS> {
|
||||
blob_service: BS,
|
||||
chunks: Vec<(u64, u64, B3Digest)>,
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ use crate::composition::{CompositionContext, ServiceBuilder};
|
|||
use crate::{proto, B3Digest, Error};
|
||||
|
||||
/// There should not be more than 10 MiB in a single cell.
|
||||
/// https://cloud.google.com/bigtable/docs/schema-design#cells
|
||||
/// <https://cloud.google.com/bigtable/docs/schema-design#cells>
|
||||
const CELL_SIZE_LIMIT: u64 = 10 * 1024 * 1024;
|
||||
|
||||
/// Provides a [DirectoryService] implementation using
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@ pub enum InodeData {
|
|||
}
|
||||
|
||||
/// This encodes the two different states of [InodeData::Directory].
|
||||
/// Either the data still is sparse (we only saw a [castorepb::DirectoryNode],
|
||||
/// but didn't fetch the [castorepb::Directory] struct yet, or we processed a
|
||||
/// Either the data still is sparse (we only saw a [crate::Node::Directory],
|
||||
/// but didn't fetch the [crate::Directory] struct yet, or we processed a
|
||||
/// lookup and did fetch the data.
|
||||
#[derive(Clone, Debug)]
|
||||
pub enum DirectoryInodeData {
|
||||
|
|
|
|||
|
|
@ -229,7 +229,7 @@ impl IngestionEntryGraph {
|
|||
Ok(index)
|
||||
}
|
||||
|
||||
/// Traverses the graph in DFS post order and collects the entries into a [Vec<IngestionEntry>].
|
||||
/// Traverses the graph in DFS post order and collects the entries into a [`Vec<IngestionEntry>`].
|
||||
///
|
||||
/// Unreachable parts of the graph are not included in the result.
|
||||
pub fn finalize(self) -> Result<Vec<IngestionEntry>, Error> {
|
||||
|
|
|
|||
|
|
@ -186,7 +186,7 @@ where
|
|||
}
|
||||
}
|
||||
|
||||
/// Uploads the file at the provided [Path] the the [BlobService].
|
||||
/// Uploads the file at the provided [std::path::Path] the the [BlobService].
|
||||
#[instrument(skip(blob_service, reference_scanner), fields(path), err)]
|
||||
async fn upload_blob<BS, P>(
|
||||
blob_service: BS,
|
||||
|
|
|
|||
|
|
@ -191,7 +191,7 @@ impl From<crate::Directory> for Directory {
|
|||
}
|
||||
|
||||
impl Entry {
|
||||
/// Converts a proto [Node] to a [crate::Node], and splits off the name as a [PathComponent].
|
||||
/// Converts a proto [Entry] to a [crate::Node], and splits off the name as a [PathComponent].
|
||||
pub fn try_into_name_and_node(self) -> Result<(PathComponent, crate::Node), DirectoryError> {
|
||||
let (name_bytes, node) = self.try_into_unchecked_name_and_checked_node()?;
|
||||
Ok((
|
||||
|
|
@ -200,7 +200,7 @@ impl Entry {
|
|||
))
|
||||
}
|
||||
|
||||
/// Converts a proto [Node] to a [crate::Node], and splits off the name as a
|
||||
/// Converts a proto [Entry] to a [crate::Node], and splits off the name as a
|
||||
/// [bytes::Bytes] without doing any checking of it.
|
||||
fn try_into_unchecked_name_and_checked_node(
|
||||
self,
|
||||
|
|
@ -245,7 +245,7 @@ impl Entry {
|
|||
}
|
||||
}
|
||||
|
||||
/// Converts a proto [Node] to a [crate::Node], and splits off the name and returns it as a
|
||||
/// Converts a proto [Entry] to a [crate::Node], and splits off the name and returns it as a
|
||||
/// [bytes::Bytes].
|
||||
///
|
||||
/// The name must be empty.
|
||||
|
|
|
|||
|
|
@ -208,7 +208,7 @@ impl<'co, 'ro, 'env, IO> EvaluationBuilder<'co, 'ro, 'env, IO> {
|
|||
///
|
||||
/// # Panics
|
||||
///
|
||||
/// Panics if this evaluation builder has had globals set via [`with_globals`]
|
||||
/// Panics if this evaluation builder has had globals set via [`Self::with_globals`]
|
||||
pub fn add_builtins<I>(mut self, builtins: I) -> Self
|
||||
where
|
||||
I: IntoIterator<Item = (&'static str, Value)>,
|
||||
|
|
@ -222,7 +222,7 @@ impl<'co, 'ro, 'env, IO> EvaluationBuilder<'co, 'ro, 'env, IO> {
|
|||
///
|
||||
/// # Panics
|
||||
///
|
||||
/// Panics if this evaluation builder has had globals set via [`with_globals`]
|
||||
/// Panics if this evaluation builder has had globals set via [`Self::with_globals`]
|
||||
pub fn add_src_builtin(mut self, name: &'static str, src: &'static str) -> Self {
|
||||
self.builtins_mut().src_builtins.push((name, src));
|
||||
self
|
||||
|
|
@ -231,7 +231,7 @@ impl<'co, 'ro, 'env, IO> EvaluationBuilder<'co, 'ro, 'env, IO> {
|
|||
/// Set the globals for this evaluation builder to a previously-constructed globals map.
|
||||
/// Intended to allow sharing globals across multiple evaluations (eg for the REPL).
|
||||
///
|
||||
/// Discards any builtins previously configured via [`add_builtins`] and [`add_src_builtins`].
|
||||
/// Discards any builtins previously configured via [`Self::add_builtins`] and [`Self::add_src_builtin`].
|
||||
/// If either of those methods is called on the evaluation builder after this one, they will
|
||||
/// panic.
|
||||
pub fn with_globals(self, globals: Rc<GlobalsMap>) -> Self {
|
||||
|
|
|
|||
|
|
@ -61,8 +61,7 @@ pub struct Lambda {
|
|||
|
||||
/// Number of upvalues which the code in this Lambda closes
|
||||
/// over, and which need to be initialised at
|
||||
/// runtime. Information about the variables is emitted using
|
||||
/// data-carrying opcodes (see [`crate::opcode::OpCode::DataStackIdx`]).
|
||||
/// runtime.
|
||||
pub(crate) upvalue_count: usize,
|
||||
pub(crate) formals: Option<Formals>,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ impl NixContext {
|
|||
/// For internal consumers, we let people observe
|
||||
/// if the [NixContext] is actually empty or not
|
||||
/// to decide whether they want to skip the allocation
|
||||
/// of a full blown [HashSet].
|
||||
/// of a full blown [std::collections::HashSet].
|
||||
pub(crate) fn is_empty(&self) -> bool {
|
||||
self.0.is_empty()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -714,7 +714,7 @@ impl NixString {
|
|||
}
|
||||
|
||||
/// Iterates over all context elements.
|
||||
/// See [iter_plain], [iter_derivation], [iter_single_outputs].
|
||||
/// See [context::NixContext::iter_plain], [context::NixContext::iter_derivation], [context::NixContext::iter_single_outputs].
|
||||
pub fn iter_context(&self) -> impl Iterator<Item = &NixContext> {
|
||||
self.context().into_iter()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ impl Debug for SuspendedNative {
|
|||
/// Internal representation of the different states of a thunk.
|
||||
///
|
||||
/// Upvalues must be finalised before leaving the initial state
|
||||
/// (Suspended or RecursiveClosure). The [`value()`] function may
|
||||
/// (Suspended or RecursiveClosure). The [`Thunk::value()`] function may
|
||||
/// not be called until the thunk is in the final state (Evaluated).
|
||||
#[derive(Debug)]
|
||||
enum ThunkRepr {
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ pub(crate) enum GeneratorState {
|
|||
/// cases, the VM will suspend the generator when receiving a message
|
||||
/// and enter some other frame to process the request.
|
||||
///
|
||||
/// Responses are returned to generators via the [`GeneratorResponse`] type.
|
||||
/// Responses are returned to generators via the [`VMResponse`] type.
|
||||
pub enum VMRequest {
|
||||
/// Request that the VM forces this value. This message is first sent to the
|
||||
/// VM with the unforced value, then returned to the generator with the
|
||||
|
|
@ -114,8 +114,7 @@ pub enum VMRequest {
|
|||
/// Request a reasonable span from the VM.
|
||||
Span,
|
||||
|
||||
/// Request evaluation of `builtins.tryEval` from the VM. See
|
||||
/// [`VM::catch_result`] for an explanation of how this works.
|
||||
/// Request evaluation of `builtins.tryEval` from the VM.
|
||||
TryForce(Value),
|
||||
|
||||
/// Request the VM for the file type of the given path.
|
||||
|
|
@ -199,7 +198,7 @@ pub enum VMResponse {
|
|||
/// VM response with a span to use at the current point.
|
||||
Span(Span),
|
||||
|
||||
/// [std::io::Reader] produced by the VM in response to some IO operation.
|
||||
/// Reader produced by the VM in response to some IO operation.
|
||||
Reader(Box<dyn std::io::Read>),
|
||||
|
||||
FileType(FileType),
|
||||
|
|
|
|||
|
|
@ -133,7 +133,7 @@ pub(crate) fn get_all_inputs<'a>(
|
|||
}
|
||||
}
|
||||
|
||||
/// Takes a [Derivation] and turns it into a [buildservice::BuildRequest].
|
||||
/// Takes a [Derivation] and turns it into a [snix_build::buildservice::BuildRequest].
|
||||
/// It assumes the Derivation has been validated, and all referenced output paths are present in `inputs`.
|
||||
pub(crate) fn derivation_to_build_request(
|
||||
derivation: &Derivation,
|
||||
|
|
|
|||
|
|
@ -36,9 +36,9 @@ pub enum Node<'a, 'r: 'a> {
|
|||
}
|
||||
|
||||
impl<'a, 'r: 'a> Node<'a, 'r> {
|
||||
/// Start reading a [Node], matching the next [wire::Node].
|
||||
/// Start reading a [Node], matching the next [nar::wire::Node].
|
||||
///
|
||||
/// Reading the terminating [wire::TOK_PAR] is done immediately for [Node::Symlink],
|
||||
/// Reading the terminating [nar::wire::TOK_PAR] is done immediately for [Node::Symlink],
|
||||
/// but is otherwise left to [DirReader] or [BytesReader].
|
||||
async fn new(reader: &'a mut Reader<'r>) -> io::Result<Self> {
|
||||
Ok(match read::tag(reader).await? {
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ use tonic::async_trait;
|
|||
use tracing::{instrument, trace, warn, Span};
|
||||
|
||||
/// There should not be more than 10 MiB in a single cell.
|
||||
/// https://cloud.google.com/bigtable/docs/schema-design#cells
|
||||
/// <https://cloud.google.com/bigtable/docs/schema-design#cells>
|
||||
const CELL_SIZE_LIMIT: u64 = 10 * 1024 * 1024;
|
||||
|
||||
/// Provides a [PathInfoService] implementation using
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ pub struct NixHTTPPathInfoService<BS, DS> {
|
|||
blob_service: BS,
|
||||
directory_service: DS,
|
||||
|
||||
/// An optional list of [narinfo::PubKey].
|
||||
/// An optional list of [narinfo::VerifyingKey].
|
||||
/// If set, the .narinfo files received need to have correct signature by at least one of these.
|
||||
public_keys: Option<Vec<narinfo::VerifyingKey>>,
|
||||
}
|
||||
|
|
@ -276,7 +276,7 @@ pub struct NixHTTPPathInfoServiceConfig {
|
|||
blob_service: String,
|
||||
directory_service: String,
|
||||
#[serde(default)]
|
||||
/// An optional list of [narinfo::PubKey].
|
||||
/// An optional list of [narinfo::VerifyingKey].
|
||||
/// If set, the .narinfo files received need to have correct signature by at least one of these.
|
||||
public_keys: Option<Vec<String>>,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue