MCPcopy Index your code
hub / github.com/cargo-lambda/cargo-lambda / build_runtime_state

Function build_runtime_state

crates/cargo-lambda-watch/src/lib.rs:169–196  ·  view source on GitHub ↗
(
    config: &Watch,
    manifest_path: &Path,
    binary_packages: HashSet<String>,
)

Source from the content-addressed store, hash-verified

167}
168
169fn build_runtime_state(
170 config: &Watch,
171 manifest_path: &Path,
172 binary_packages: HashSet<String>,
173) -> Result<RuntimeState> {
174 let ip = IpAddr::from_str(&config.invoke_address)
175 .into_diagnostic()
176 .wrap_err("invalid invoke address")?;
177 let (runtime_port, proxy_addr) = if config.tls_options.is_secure() {
178 (
179 config.invoke_port + 1,
180 Some(SocketAddr::from((ip, config.invoke_port))),
181 )
182 } else {
183 (config.invoke_port, None)
184 };
185 let runtime_addr = SocketAddr::from((ip, runtime_port));
186
187 Ok(RuntimeState::new(
188 runtime_addr,
189 proxy_addr,
190 manifest_path.to_path_buf(),
191 config.only_lambda_apis,
192 binary_packages,
193 config.router.clone(),
194 config.concurrency,
195 ))
196}
197
198async fn start_server(
199 subsys: SubsystemHandle,

Callers 1

runFunction · 0.85

Calls 2

newFunction · 0.85
is_secureMethod · 0.80

Tested by

no test coverage detected