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 <flokli@flokli.de>
Reviewed-by: Connor Brewster <cbrewster@hey.com>
Tested-by: BuildkiteCI
This commit is contained in:
Florian Klink 2023-10-17 11:07:01 +01:00 committed by clbot
parent 718af22dbb
commit 1bb7e84241

View file

@ -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.