pub struct EngineRegistry {
pub installed_engines: HashMap<String, EngineInfo>,
pub available_engines: Vec<EngineInfo>,
pub default_engine: Option<String>,
pub storage_path: PathBuf,
/* private fields */
}Expand description
Manages the registry of available and installed engines
Fields§
§installed_engines: HashMap<String, EngineInfo>§available_engines: Vec<EngineInfo>§default_engine: Option<String>§storage_path: PathBufImplementations§
Source§impl EngineRegistry
impl EngineRegistry
pub fn new() -> Result<Self>
Sourcepub async fn scan_installed_engines(
&mut self,
hardware_capabilities: &HardwareCapabilities,
) -> Result<()>
pub async fn scan_installed_engines( &mut self, hardware_capabilities: &HardwareCapabilities, ) -> Result<()>
Scan for already installed engines in the storage directory
Sourcepub fn get_compatible_engines(
&self,
hardware: &HardwareCapabilities,
) -> Vec<&EngineInfo>
pub fn get_compatible_engines( &self, hardware: &HardwareCapabilities, ) -> Vec<&EngineInfo>
Get engines compatible with given hardware capabilities
Sourcepub fn select_best_compatible_engine(
&self,
hardware: &HardwareCapabilities,
) -> Option<EngineInfo>
pub fn select_best_compatible_engine( &self, hardware: &HardwareCapabilities, ) -> Option<EngineInfo>
Select the best compatible engine for given hardware
Sourcepub fn get_recommended_engine(
&self,
hardware: &HardwareCapabilities,
) -> Option<EngineInfo>
pub fn get_recommended_engine( &self, hardware: &HardwareCapabilities, ) -> Option<EngineInfo>
Get recommended engine for current hardware (downloads new if needed)
Sourcepub fn set_default_engine(&mut self, engine_id: &str) -> Result<()>
pub fn set_default_engine(&mut self, engine_id: &str) -> Result<()>
Set the default engine for single-engine mode
Sourcepub fn has_installed_engine(&self) -> bool
pub fn has_installed_engine(&self) -> bool
Check if we have any installed engine
Sourcepub fn get_default_engine(&self) -> Option<&EngineInfo>
pub fn get_default_engine(&self) -> Option<&EngineInfo>
Get the default engine (single-engine model)
Sourcepub async fn add_installed_engine(&mut self, engine: EngineInfo) -> Result<()>
pub async fn add_installed_engine(&mut self, engine: EngineInfo) -> Result<()>
Add a newly installed engine to the registry
Sourcepub async fn refresh_available_engines(
&mut self,
hardware_capabilities: &HardwareCapabilities,
) -> Result<()>
pub async fn refresh_available_engines( &mut self, hardware_capabilities: &HardwareCapabilities, ) -> Result<()>
Refresh available engines from official sources
Sourcepub fn get_default_engine_binary_path(&self) -> Option<PathBuf>
pub fn get_default_engine_binary_path(&self) -> Option<PathBuf>
Get the path to the default engine binary
Sourcepub fn mark_download_started(&self) -> bool
pub fn mark_download_started(&self) -> bool
Mark that a download has started. Returns true if the download was started, false if another download is already in progress.
Sourcepub fn mark_download_finished(&self)
pub fn mark_download_finished(&self)
Mark that a download has finished (either successfully or with error)
Sourcepub fn is_download_in_progress(&self) -> bool
pub fn is_download_in_progress(&self) -> bool
Check if a download is currently in progress
Auto Trait Implementations§
impl Freeze for EngineRegistry
impl RefUnwindSafe for EngineRegistry
impl Send for EngineRegistry
impl Sync for EngineRegistry
impl Unpin for EngineRegistry
impl UnsafeUnpin for EngineRegistry
impl UnwindSafe for EngineRegistry
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> 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