pub struct SimulationAssetsService { /* private fields */ }Expand description
Service for managing simulation assets
Implementations§
Source§impl SimulationAssetsService
impl SimulationAssetsService
Sourcepub fn current_assets_path(&self) -> Option<PathBuf>
pub fn current_assets_path(&self) -> Option<PathBuf>
Get the path to the current simulation assets
Returns the path to ~/.mecha10/simulation/current if it exists
Sourcepub fn godot_project_path(&self) -> Option<PathBuf>
pub fn godot_project_path(&self) -> Option<PathBuf>
Get the Godot project path from cached assets
Sourcepub fn models_path(&self) -> Option<PathBuf>
pub fn models_path(&self) -> Option<PathBuf>
Get the models directory from cached assets
Sourcepub fn environments_path(&self) -> Option<PathBuf>
pub fn environments_path(&self) -> Option<PathBuf>
Get the environments directory from cached assets
Sourcepub fn is_installed(&self) -> bool
pub fn is_installed(&self) -> bool
Check if simulation assets are installed
Sourcepub fn installed_version(&self) -> Option<String>
pub fn installed_version(&self) -> Option<String>
Get the installed version (if any)
Sourcepub async fn ensure_assets(&self) -> Result<PathBuf>
pub async fn ensure_assets(&self) -> Result<PathBuf>
Ensure simulation assets are available, downloading if needed
Returns the path to the simulation assets directory
Sourcepub async fn download_latest(&self) -> Result<PathBuf>
pub async fn download_latest(&self) -> Result<PathBuf>
Download the latest simulation assets from GitHub releases
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SimulationAssetsService
impl RefUnwindSafe for SimulationAssetsService
impl Send for SimulationAssetsService
impl Sync for SimulationAssetsService
impl Unpin for SimulationAssetsService
impl UnwindSafe for SimulationAssetsService
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> 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