MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / parse

Method parse

crates/openshell-supervisor-network/src/l7/mod.rs:35–45  ·  view source on GitHub ↗
(s: &str)

Source from the content-addressed store, hash-verified

33
34impl L7Protocol {
35 pub fn parse(s: &str) -> Option<Self> {
36 match s.to_ascii_lowercase().as_str() {
37 "rest" => Some(Self::Rest),
38 "websocket" => Some(Self::Websocket),
39 "graphql" => Some(Self::Graphql),
40 "sql" => Some(Self::Sql),
41 "json-rpc" => Some(Self::JsonRpc),
42 "mcp" => Some(Self::Mcp),
43 _ => None,
44 }
45 }
46
47 pub fn is_jsonrpc_family(self) -> bool {
48 matches!(self, Self::JsonRpc | Self::Mcp)

Callers 15

read_ppidFunction · 0.45
parse_proc_net_tcpFunction · 0.45
parse_targetFunction · 0.45
try_parse_http_requestFunction · 0.45
classify_documentFunction · 0.45
parse_body_lengthFunction · 0.45
parse_status_codeFunction · 0.45
prepare_filesystemFunction · 0.45
drop_privilegesFunction · 0.45
newMethod · 0.45

Calls 1

as_strMethod · 0.45