From 1bb7e84241be81effd7ca57182b2d6edaddc1508 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Tue, 17 Oct 2023 11:07:01 +0100 Subject: docs(tvix/castore/directorysvc): document drop without put and close As seen in cl/9761, we only use put() and close() in some cases. Make sure this is documented, so we don't end up having implementations not able to deal with that. Change-Id: I406ad23f2f4c9604eca731d898ae41a4663fb846 Reviewed-on: https://cl.tvl.fyi/c/depot/+/9786 Autosubmit: flokli Reviewed-by: Connor Brewster Tested-by: BuildkiteCI --- tvix/castore/src/directoryservice/mod.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tvix') diff --git a/tvix/castore/src/directoryservice/mod.rs b/tvix/castore/src/directoryservice/mod.rs index 3b26f4baf79b..65beeef4a26c 100644 --- a/tvix/castore/src/directoryservice/mod.rs +++ b/tvix/castore/src/directoryservice/mod.rs @@ -58,6 +58,10 @@ pub trait DirectoryService: Send + Sync { /// The consumer can periodically call [DirectoryPutter::put], starting from the /// leaves. Once the root is reached, [DirectoryPutter::close] can be called to /// retrieve the root digest (or an error). +/// +/// DirectoryPutters might be created without a single [put], and then dropped +/// without calling [close], for example when ingesting a path that ends up not +/// pointing to a directory, but a single file or symlink. #[async_trait] pub trait DirectoryPutter: Send { /// Put a individual [proto::Directory] into the store. -- cgit 1.4.1