diff options
author | Yureka <tvl@yuka.dev> | 2024-07-19T08·51+0200 |
---|---|---|
committer | clbot <clbot@tvl.fyi> | 2024-07-19T15·13+0000 |
commit | 4801d6bf85ebb47910dd4bfe9db11846ff438572 (patch) | |
tree | e651fdb7eb7c104155e7b3c2b812a0bfa5e54928 /tvix/castore/src/directoryservice/combinators.rs | |
parent | 7ccdf6dad561a5be37bab3d199af87f0d71bafca (diff) |
feat(tvix): different service types in one composition r/8372
This will be necessary for the PathInfoService composition, as some PathInfoService implementations require a BlobService & DirectoryService to ingest into. Using the Extend trait for creating compositions allows extending the same composition with configs of various types e.g. BlobStore, DirectoryStore Generics are moved from the Composition struct to the functions.The storage of the InstantiatonStates uses the TypeId in the key and a Box<dyn Any> in the value, which is downcasted to InstantiatonState<T>. Change-Id: I2af11f26c535029adfb1c62905e0e7c4aaed7b51 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11980 Reviewed-by: flokli <flokli@flokli.de> Reviewed-by: raitobezarius <tvl@lahfa.xyz> Tested-by: BuildkiteCI Autosubmit: yuka <yuka@yuka.dev>
Diffstat (limited to 'tvix/castore/src/directoryservice/combinators.rs')
-rw-r--r-- | tvix/castore/src/directoryservice/combinators.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tvix/castore/src/directoryservice/combinators.rs b/tvix/castore/src/directoryservice/combinators.rs index 74d02f1ad2b9..0fdc82c16cb0 100644 --- a/tvix/castore/src/directoryservice/combinators.rs +++ b/tvix/castore/src/directoryservice/combinators.rs @@ -167,7 +167,7 @@ impl ServiceBuilder for CacheConfig { async fn build<'a>( &'a self, _instance_name: &str, - context: &CompositionContext<dyn DirectoryService>, + context: &CompositionContext, ) -> Result<Arc<dyn DirectoryService>, Box<dyn std::error::Error + Send + Sync + 'static>> { let (near, far) = futures::join!( context.resolve(self.near.clone()), |