refactor(tvix/store): use composition in tvix_store crate
Change-Id: Ie6290b296baba2b987f1a61c9bb4c78549ac11f1 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11983 Reviewed-by: flokli <flokli@flokli.de> Autosubmit: yuka <yuka@yuka.dev> Tested-by: BuildkiteCI
This commit is contained in:
parent
6180a7cecf
commit
8b77c7fcd7
20 changed files with 569 additions and 251 deletions
22
tvix/store/src/composition.rs
Normal file
22
tvix/store/src/composition.rs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
use lazy_static::lazy_static;
|
||||
|
||||
pub use tvix_castore::composition::*;
|
||||
|
||||
lazy_static! {
|
||||
/// The provided registry of tvix_store, which has all the builtin
|
||||
/// tvix_castore (BlobStore/DirectoryStore) and tvix_store
|
||||
/// (PathInfoService) implementations.
|
||||
pub static ref REG: Registry = {
|
||||
let mut reg = Default::default();
|
||||
add_default_services(&mut reg);
|
||||
reg
|
||||
};
|
||||
}
|
||||
|
||||
/// Register the builtin services of tvix_castore and tvix_store with the given
|
||||
/// registry. This is useful for creating your own registry with the builtin
|
||||
/// types _and_ extra third party types.
|
||||
pub fn add_default_services(reg: &mut Registry) {
|
||||
tvix_castore::composition::add_default_services(reg);
|
||||
crate::pathinfoservice::register_pathinfo_services(reg);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue