pub struct TranslatorConfig {
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§
§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(session: SessionContext) -> Result<Self>
pub fn new(session: SessionContext) -> Result<Self>
Creates a new TranslatorConfig from a SessionContext, computing all derived paths.
Sourcepub fn local_config(base_dir: impl AsRef<Path>) -> Result<Self>
pub fn local_config(base_dir: impl AsRef<Path>) -> Result<Self>
Creates a TranslatorConfig for local filesystem-based storage.
Sourcepub fn memory_config(base_dir: impl AsRef<Path>) -> Result<Self>
pub fn memory_config(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(
endpoint: impl AsRef<str>,
base_dir: impl AsRef<Path>,
) -> Result<Self>
pub fn test_server_config( 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§
Auto Trait Implementations§
impl Freeze for TranslatorConfig
impl !RefUnwindSafe for TranslatorConfig
impl Send for TranslatorConfig
impl Sync for TranslatorConfig
impl Unpin for TranslatorConfig
impl UnsafeUnpin for TranslatorConfig
impl !UnwindSafe 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> 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