pub struct DevService { /* private fields */ }Expand description
Development mode service
Provides business logic for development mode operations:
- Port availability checking
- Redis state management
- Simulation path resolution
- Environment variable setup
§Examples
ⓘ
use mecha10_cli::services::DevService;
let service = DevService::new();
// Check if port is available
if service.is_port_available(11008)? {
println!("Port 11008 is available");
}
// Flush Redis for clean dev session
service.flush_redis(&mut redis_conn).await?;Implementations§
Source§impl DevService
impl DevService
Sourcepub async fn load_project_info(
ctx: &mut CliContext,
) -> Result<(String, String, ProjectConfig)>
pub async fn load_project_info( ctx: &mut CliContext, ) -> Result<(String, String, ProjectConfig)>
Load project information from context
§Returns
Tuple of (project_name, project_version, project_config)
Sourcepub fn resolve_simulation_paths(
ctx: &mut CliContext,
config: &ProjectConfig,
) -> Result<Option<SimulationPaths>>
pub fn resolve_simulation_paths( ctx: &mut CliContext, config: &ProjectConfig, ) -> Result<Option<SimulationPaths>>
Sourcepub fn is_port_available(&self, port: u16) -> Result<bool>
pub fn is_port_available(&self, port: u16) -> Result<bool>
Sourcepub fn is_port_in_use(&self, port: u16) -> Result<bool>
pub fn is_port_in_use(&self, port: u16) -> Result<bool>
Sourcepub async fn flush_redis<C>(&self, conn: &mut C) -> Result<()>where
C: ConnectionLike,
pub async fn flush_redis<C>(&self, conn: &mut C) -> Result<()>where
C: ConnectionLike,
Sourcepub fn get_default_env_vars(&self) -> HashMap<String, String>
pub fn get_default_env_vars(&self) -> HashMap<String, String>
Get default environment variables for dev mode
§Returns
HashMap of environment variable key-value pairs
Note: This method is no longer used by CLI (replaced by node-runner in Phase 2). Kept for testing purposes.
Sourcepub fn build_godot_args(
&self,
godot_project_path: &Path,
model_path: &Path,
env_path: &Path,
model_config_path: Option<&PathBuf>,
env_config_path: Option<&PathBuf>,
headless: bool,
networking: Option<&NetworkingConfig>,
) -> Vec<String>
pub fn build_godot_args( &self, godot_project_path: &Path, model_path: &Path, env_path: &Path, model_config_path: Option<&PathBuf>, env_config_path: Option<&PathBuf>, headless: bool, networking: Option<&NetworkingConfig>, ) -> Vec<String>
Sourcepub fn get_godot_project_path(&self) -> PathBuf
pub fn get_godot_project_path(&self) -> PathBuf
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DevService
impl RefUnwindSafe for DevService
impl Send for DevService
impl Sync for DevService
impl Unpin for DevService
impl UnwindSafe for DevService
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