pub struct TranslatorConfig {
pub ctx: XetContext,
pub session: SessionContext,
pub shard_cache_directory: PathBuf,
pub shard_session_directory: PathBuf,
pub force_disable_progress_aggregation: bool,
}Expand description
Main configuration for file upload/download operations. Combines session-specific values with runtime-computed paths derived from the endpoint.
Fields§
§ctx: XetContext§session: SessionContext§shard_cache_directory: PathBufDirectory for caching shard files.
shard_session_directory: PathBufDirectory for session-specific shard files.
force_disable_progress_aggregation: boolPer-session override: when true, progress aggregation is disabled
regardless of the global HF_XET_DATA_AGGREGATE_PROGRESS config value.
Implementations§
Source§impl TranslatorConfig
impl TranslatorConfig
Sourcepub fn new(ctx: &XetContext, session: SessionContext) -> Result<Self>
pub fn new(ctx: &XetContext, session: SessionContext) -> Result<Self>
Creates a new TranslatorConfig from a SessionContext, computing all derived paths.
On WASM, no filesystem directories are created. Shard cache and session directories are set to empty paths since the WASM build does not exercise disk-backed shard staging or shard-cache paths.
Sourcepub fn local_config(
ctx: &XetContext,
base_dir: impl AsRef<Path>,
) -> Result<Self>
pub fn local_config( ctx: &XetContext, base_dir: impl AsRef<Path>, ) -> Result<Self>
Creates a TranslatorConfig for local filesystem-based storage.
Sourcepub fn memory_config(
ctx: &XetContext,
base_dir: impl AsRef<Path>,
) -> Result<Self>
pub fn memory_config( ctx: &XetContext, base_dir: impl AsRef<Path>, ) -> Result<Self>
Creates a TranslatorConfig that uses in-memory storage for XORBs. Shard data still uses file-based storage in the provided base directory.
Sourcepub fn test_server_config(
ctx: &XetContext,
endpoint: impl AsRef<str>,
base_dir: impl AsRef<Path>,
) -> Result<Self>
pub fn test_server_config( ctx: &XetContext, endpoint: impl AsRef<str>, base_dir: impl AsRef<Path>, ) -> Result<Self>
Creates a TranslatorConfig that connects to a CAS server at the given endpoint. Shard cache and session directories are created under the provided base directory. Useful for tests that use LocalTestServer.
pub fn disable_progress_aggregation(self) -> Self
Trait Implementations§
Source§impl Clone for TranslatorConfig
impl Clone for TranslatorConfig
Source§fn clone(&self) -> TranslatorConfig
fn clone(&self) -> TranslatorConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for TranslatorConfig
impl !UnwindSafe for TranslatorConfig
impl Freeze for TranslatorConfig
impl Send for TranslatorConfig
impl Sync for TranslatorConfig
impl Unpin for TranslatorConfig
impl UnsafeUnpin for TranslatorConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DropFlavorWrapper<T> for T
impl<T> DropFlavorWrapper<T> for T
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more