MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / service_metadata_for_test

Function service_metadata_for_test

packages/server/src/main.rs:6197–6223  ·  view source on GitHub ↗
(
        port: u16,
        bind: &str,
        advertise_host: Option<&str>,
        client_root: Option<&str>,
    )

Source from the content-addressed store, hash-verified

6195 use std::path::{Path, PathBuf};
6196
6197 fn service_metadata_for_test(
6198 port: u16,
6199 bind: &str,
6200 advertise_host: Option<&str>,
6201 client_root: Option<&str>,
6202 ) -> ServiceMetadata {
6203 ServiceMetadata {
6204 project_root: PathBuf::from("/tmp/project"),
6205 pid: 42,
6206 http_url: format!("http://127.0.0.1:{port}"),
6207 port,
6208 bind: bind.parse().unwrap(),
6209 advertise_host: advertise_host.map(str::to_owned),
6210 client_root: client_root.map(PathBuf::from),
6211 access_token: "token".to_owned(),
6212 pairing_code: Some("123456".to_owned()),
6213 binary_path: PathBuf::from("/tmp/simdeck-bin"),
6214 started_at: 1,
6215 log_path: None,
6216 video_codec: Some(VideoCodecMode::Auto.as_env_value().to_owned()),
6217 android_gpu: Some(AndroidGpuMode::Host.as_emulator_value().to_owned()),
6218 low_latency: false,
6219 realtime_stream: true,
6220 stream_quality_profile: Some(DEFAULT_LOCAL_STREAM_QUALITY_PROFILE.to_owned()),
6221 local_stream_fps: None,
6222 }
6223 }
6224
6225 fn service_launch_options_for_test(
6226 port: u16,

Calls 3

as_env_valueMethod · 0.80
as_emulator_valueMethod · 0.80
parseMethod · 0.45