pub struct SessionContext {
pub endpoint: String,
pub auth: Option<AuthConfig>,
pub custom_headers: Option<Arc<HeaderMap>>,
pub repo_paths: Vec<String>,
pub session_id: Option<String>,
}Expand description
Session-specific configuration that varies per upload/download session. These are runtime values that cannot be configured via environment variables.
Fields§
§endpoint: StringThe endpoint URL. Use the local:// prefix (configurable via HF_XET_DATA_LOCAL_CAS_SCHEME)
to specify a local filesystem path, or memory:// for in-memory storage.
auth: Option<AuthConfig>§custom_headers: Option<Arc<HeaderMap>>§repo_paths: Vec<String>§session_id: Option<String>Implementations§
Source§impl SessionContext
impl SessionContext
Sourcepub fn is_local(&self) -> bool
pub fn is_local(&self) -> bool
Returns true if this endpoint points to a local filesystem path.
Sourcepub fn local_path(&self) -> Option<PathBuf>
pub fn local_path(&self) -> Option<PathBuf>
Returns the local filesystem path if this is a local endpoint.
Sourcepub fn for_local_path(base_dir: impl AsRef<Path>) -> Self
pub fn for_local_path(base_dir: impl AsRef<Path>) -> Self
Creates a SessionContext for local filesystem-based operations.
Sourcepub fn for_memory() -> Self
pub fn for_memory() -> Self
Creates a SessionContext for in-memory storage.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SessionContext
impl !RefUnwindSafe for SessionContext
impl Send for SessionContext
impl Sync for SessionContext
impl Unpin for SessionContext
impl UnsafeUnpin for SessionContext
impl !UnwindSafe for SessionContext
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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