MCPcopy Create free account
hub / github.com/cargo-lambda/cargo-lambda / at

Method at

crates/cargo-lambda-metadata/src/cargo/watch.rs:255–270  ·  view source on GitHub ↗
(
        &self,
        path: &str,
        method: &str,
    )

Source from the content-addressed store, hash-verified

253
254impl FunctionRouter {
255 pub fn at(
256 &self,
257 path: &str,
258 method: &str,
259 ) -> Result<(String, HashMap<String, String>), MatchError> {
260 let matched = self.inner.at(path)?;
261 let function = matched.value.at(method).ok_or(MatchError::NotFound)?;
262
263 let params = matched
264 .params
265 .iter()
266 .map(|(k, v)| (k.to_string(), v.to_string()))
267 .collect();
268
269 Ok((function.to_string(), params))
270 }
271
272 pub fn insert(&mut self, path: &str, routes: FunctionRoutes) -> Result<(), InsertError> {
273 self.inner.insert(path, routes)

Callers 2

test_router_getFunction · 0.80
extract_path_parametersFunction · 0.80

Calls 2

getMethod · 0.80
as_strMethod · 0.80

Tested by 1

test_router_getFunction · 0.64