docs(tvix/[ca]store): improve docstrings, remove wildcard imports

Extend the docstrings of `add_default_services`, and add one for
`addrs_to_configs` as well as the module-wide one at
`tvix_store::composition`.

Change-Id: Ie9b449988eb210cd65b19b174094bbe0c4af2fd6
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12748
Tested-by: BuildkiteCI
Reviewed-by: yuka <yuka@yuka.dev>
This commit is contained in:
Florian Klink 2024-11-09 14:20:03 +00:00 committed by flokli
parent e71a857ec8
commit a9f453f6da
4 changed files with 31 additions and 14 deletions

View file

@ -9,11 +9,12 @@ use tokio::io::{self, AsyncWrite};
use tvix_castore::{blobservice::BlobService, directoryservice::DirectoryService};
use url::Url;
use crate::composition::{
with_registry, Composition, DeserializeWithRegistry, ServiceBuilder, REG,
};
use crate::composition::REG;
use crate::nar::{NarCalculationService, SimpleRenderer};
use crate::pathinfoservice::PathInfoService;
use tvix_castore::composition::{
with_registry, Composition, DeserializeWithRegistry, ServiceBuilder,
};
#[derive(serde::Deserialize, Default)]
pub struct CompositionConfigs {
@ -127,6 +128,10 @@ impl From<ServiceUrlsMemory> for ServiceUrls {
}
}
/// Deserializes service addresses into composition config, configuring each
/// service as the single "root".
/// If the `xp-composition-cli` feature is enabled, and a file specified in the
/// `--experimental-store-composition` parameter, this is used instead.
pub async fn addrs_to_configs(
urls: impl Into<ServiceUrls>,
) -> Result<CompositionConfigs, Box<dyn std::error::Error + Send + Sync>> {