snix/tvix/castore/src
Marijan Petričević e8040ec61f refactor(tvix/store): use strictly typed PathInfo struct
This switches the PathInfoService trait from using the proto-derived
PathInfo struct to a more restrictive struct, and updates all
implementations to use it.

It removes a lot of the previous conversion and checks, as invalid
states became nonrepresentable, and validations are expressed on the
type level.

PathInfoService implementations consuming protobuf need to convert and
do the verification internally, and can only return the strongly typed
variant.

The nix_compat::narinfo::NarInfo conversions for the proto PathInfo
are removed, we only keep a version showing a NarInfo representation for
the strong struct.

Converting back to a PathInfo requires the root node now, but is
otherwise trivial, so left to the users.

Co-Authored-By: Florian Klink <flokli@flokli.de>
Change-Id: I6fdfdb44063efebb44a8f0097b6b81a828717e03
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12588
Reviewed-by: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
2024-10-11 17:18:20 +00:00
..
blobservice feat(tvix/composition): allow urls as anonymous stores 2024-10-10 12:53:08 +00:00
directoryservice feat(tvix/composition): allow urls as anonymous stores 2024-10-10 12:53:08 +00:00
fs chore(tvix/castore/fuse): impl Layer for TvixStoreFs 2024-09-28 13:30:36 +00:00
import feat(castore/fs): optional refscanner for ingest 2024-10-01 13:40:51 +00:00
nodes refactor(tvix/castore): have SymlinkTarget-specific errors 2024-08-18 17:22:21 +00:00
path refactor(tvix/castore): have PathComponent-specific errors 2024-08-18 17:22:21 +00:00
proto refactor(tvix/store): use strictly typed PathInfo struct 2024-10-11 17:18:20 +00:00
tests feat(castore/fs): optional refscanner for ingest 2024-10-01 13:40:51 +00:00
composition.rs feat(tvix/composition): allow urls as anonymous stores 2024-10-10 12:53:08 +00:00
digests.rs refactor(tvix/castore): use Directory struct separate from proto one 2024-08-13 12:17:01 +00:00
errors.rs fix(tvix/nar-bridge): Remove name check for root node in nar generation 2024-09-24 09:45:33 +00:00
fixtures.rs feat(tvix/castore): add Directory::try_from_iter() 2024-08-18 16:49:58 +00:00
hashing_reader.rs refactor(tvix/castore/hashing_reader): migrate to rstest 2024-04-07 14:51:47 +00:00
lib.rs refactor(tvix): move refscan module to castore 2024-09-27 20:39:58 +00:00
refscan.rs test(tvix/castore/refscan): add empty pattern regression test 2024-10-01 15:36:43 +00:00
tonic.rs chore(tvix): upgrade to tonic 0.12 / hyper 1.0 2024-07-21 11:01:38 +00:00