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

Method from_service

packages/server/src/main.rs:2017–2034  ·  view source on GitHub ↗
(result: service::ServiceInstallResult)

Source from the content-addressed store, hash-verified

2015
2016impl PairingTarget {
2017 fn from_service(result: service::ServiceInstallResult) -> anyhow::Result<Self> {
2018 Ok(Self {
2019 target: "service",
2020 service: Some(result.service),
2021 project_root: None,
2022 pid: None,
2023 http_url: http_url_for_host("127.0.0.1", result.port),
2024 port: result.port,
2025 advertise_host: result.advertise_host,
2026 server_id: result
2027 .access_token
2028 .as_deref()
2029 .map(auth::server_identity_for_token),
2030 pairing_code: result
2031 .pairing_code
2032 .context("SimDeck service did not publish a pairing code")?,
2033 })
2034 }
2035}
2036
2037fn print_pairing_result(target: &PairingTarget, started: bool, json: bool) -> anyhow::Result<()> {

Callers

nothing calls this directly

Calls 1

http_url_for_hostFunction · 0.85

Tested by

no test coverage detected