From d3da3238c2483bb82c65f7325ca696cc6da461a7 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Thu, 13 Mar 2025 07:11:18 +0100 Subject: [PATCH] docs(tvix/castore): fix docstrings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There were some broken references. Also, during the split of service urls to castore and store parts we forgot to update the docstring. Change-Id: Ifc2b3a2c49c9e4d31f1b210dbfe4afcad8a8d5bd Reviewed-on: https://cl.tvl.fyi/c/depot/+/13249 Reviewed-by: Marijan Petričević Autosubmit: flokli Tested-by: BuildkiteCI Reviewed-by: Domen Kožar --- tvix/castore/src/blobservice/from_addr.rs | 6 +++--- tvix/castore/src/fs/fuse/mod.rs | 2 +- tvix/castore/src/import/fs.rs | 3 ++- tvix/castore/src/nodes/directory.rs | 2 +- tvix/castore/src/nodes/mod.rs | 4 ++-- tvix/castore/src/path/mod.rs | 2 +- tvix/castore/src/utils.rs | 6 +++--- 7 files changed, 13 insertions(+), 12 deletions(-) diff --git a/tvix/castore/src/blobservice/from_addr.rs b/tvix/castore/src/blobservice/from_addr.rs index 803e7fa6a..7eb0031ca 100644 --- a/tvix/castore/src/blobservice/from_addr.rs +++ b/tvix/castore/src/blobservice/from_addr.rs @@ -11,9 +11,9 @@ use super::BlobService; /// Constructs a new instance of a [BlobService] from an URI. /// /// The following schemes are supported by the following services: -/// - `memory://` ([MemoryBlobService]) -/// - `grpc+*://` ([GRPCBlobService]) -/// - `objectstore+*://` ([ObjectStoreBlobService]) +/// - `memory://` ([super::MemoryBlobService]) +/// - `grpc+*://` ([super::GRPCBlobService]) +/// - `objectstore+*://` ([super::ObjectStoreBlobService]) /// /// See their `from_url` methods for more details about their syntax. pub async fn from_addr( diff --git a/tvix/castore/src/fs/fuse/mod.rs b/tvix/castore/src/fs/fuse/mod.rs index 64ef29ed2..087aac258 100644 --- a/tvix/castore/src/fs/fuse/mod.rs +++ b/tvix/castore/src/fs/fuse/mod.rs @@ -51,7 +51,7 @@ where } } -/// Starts a [Filesystem] with the specified number of threads, and provides +/// Starts a [FileSystem] with the specified number of threads, and provides /// functions to unmount, and wait for it to have completed. #[derive(Clone)] pub struct FuseDaemon { diff --git a/tvix/castore/src/import/fs.rs b/tvix/castore/src/import/fs.rs index 78eac6f61..eb1f1ef74 100644 --- a/tvix/castore/src/import/fs.rs +++ b/tvix/castore/src/import/fs.rs @@ -78,7 +78,8 @@ where /// /// The produced stream is buffered, so uploads can happen concurrently. /// -/// The root is the [Path] in the filesystem that is being ingested into the castore. +/// The root is the [std::path::Path] in the filesystem that is being ingested +/// into castore. pub fn dir_entries_to_ingestion_stream<'a, BS, I, P>( blob_service: BS, iter: I, diff --git a/tvix/castore/src/nodes/directory.rs b/tvix/castore/src/nodes/directory.rs index f80e055dd..c836001f8 100644 --- a/tvix/castore/src/nodes/directory.rs +++ b/tvix/castore/src/nodes/directory.rs @@ -77,7 +77,7 @@ impl Directory { /// will yield an error, as well as exceeding the maximum size. /// /// In case you want to construct a [Directory] from multiple elements, use - /// [from_iter] instead. + /// [Directory::try_from_iter] instead. pub fn add(&mut self, name: PathComponent, node: Node) -> Result<(), DirectoryError> { check_insert_node(self.size(), &mut self.nodes, name, node)?; Ok(()) diff --git a/tvix/castore/src/nodes/mod.rs b/tvix/castore/src/nodes/mod.rs index ac7aa1e66..5f94c0e1c 100644 --- a/tvix/castore/src/nodes/mod.rs +++ b/tvix/castore/src/nodes/mod.rs @@ -6,9 +6,9 @@ use crate::B3Digest; pub use directory::Directory; pub use symlink_target::{SymlinkTarget, SymlinkTargetError}; -/// A Node is either a [DirectoryNode], [FileNode] or [SymlinkNode]. +/// A Node is either a directory, file or symlink. /// Nodes themselves don't have names, what gives them names is either them -/// being inside a [Directory], or a root node with its own name attached to it. +/// being inside a [Directory], or a root node with a name attached adjacently. #[derive(Debug, Clone, PartialEq, Eq)] pub enum Node { /// A DirectoryNode is a pointer to a [Directory], by its [Directory::digest]. diff --git a/tvix/castore/src/path/mod.rs b/tvix/castore/src/path/mod.rs index 15f31a570..a8ce9b6ad 100644 --- a/tvix/castore/src/path/mod.rs +++ b/tvix/castore/src/path/mod.rs @@ -251,7 +251,7 @@ impl PathBuf { PathBuf { inner: bytes } } - /// Convert from a [&std::path::Path] to [Self]. + /// Convert from a [std::path::Path] to [PathBuf]. /// /// - Self uses `/` as path separator. /// - Absolute paths are always rejected, are are these with custom prefixes. diff --git a/tvix/castore/src/utils.rs b/tvix/castore/src/utils.rs index 4fc605e84..4f8f2c6be 100644 --- a/tvix/castore/src/utils.rs +++ b/tvix/castore/src/utils.rs @@ -18,7 +18,7 @@ pub struct CompositionConfigs { >, } -/// Provides a set clap arguments to configure tvix-[ca]store services. +/// Provides a set of clap arguments to configure tvix-castore services. /// /// This particular variant has defaults tailored for usecases accessing data /// directly locally, like the `tvix-store daemon` command. @@ -47,7 +47,7 @@ pub struct ServiceUrls { experimental_store_composition: Option, } -/// Provides a set clap arguments to configure tvix-[ca]store services. +/// Provides a set of clap arguments to configure tvix-castore services. /// /// This particular variant has defaults tailored for usecases accessing data /// from another running tvix daemon, via gRPC. @@ -65,7 +65,7 @@ pub struct ServiceUrlsGrpc { experimental_store_composition: Option, } -/// Provides a set clap arguments to configure tvix-[ca]store services. +/// Provides a set of clap arguments to configure tvix-castore services. /// /// This particular variant has defaults tailored for usecases keeping all data /// in memory.