pub struct StoragePaths { /* private fields */ }Expand description
Storage manager for organizing models, LoRAs, and other data
Implementations§
Source§impl StoragePaths
impl StoragePaths
Sourcepub fn new() -> Result<Self>
pub fn new() -> Result<Self>
Create a new storage paths manager.
Respects HYPRSTREAM_INSTANCE: when set, uses
hyprstream/instances/{value} as the XDG prefix so that credentials,
registry state, and models are isolated between concurrent instances on
the same host (mirrors the socket-path isolation in hyprstream-rpc/paths.rs).
Sourcepub fn models_dir(&self) -> Result<PathBuf>
pub fn models_dir(&self) -> Result<PathBuf>
Get the models directory path
Sourcepub fn config_dir(&self) -> Result<PathBuf>
pub fn config_dir(&self) -> Result<PathBuf>
Get the config directory path
Sourcepub fn state_dir(&self) -> Result<PathBuf>
pub fn state_dir(&self) -> Result<PathBuf>
Get the state directory path (XDG state home, instance-namespaced).
Used for runtime-mutated state (e.g. JWT rotation slots, #803) that must stay writable even when the config/credentials dir is a read-only systemd credentials ramfs.
Sourcepub fn temp_download_dir(&self) -> Result<PathBuf>
pub fn temp_download_dir(&self) -> Result<PathBuf>
Get the temporary download directory
Sourcepub fn list_local_models(&self) -> Result<Vec<String>>
pub fn list_local_models(&self) -> Result<Vec<String>>
List all models in the models directory
Sourcepub fn list_local_loras(&self) -> Result<Vec<String>>
pub fn list_local_loras(&self) -> Result<Vec<String>>
List all LoRAs in the LoRAs directory
Auto Trait Implementations§
impl Freeze for StoragePaths
impl RefUnwindSafe for StoragePaths
impl Send for StoragePaths
impl Sync for StoragePaths
impl Unpin for StoragePaths
impl UnsafeUnpin for StoragePaths
impl UnwindSafe for StoragePaths
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request