(s: &str)
| 33 | |
| 34 | impl 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) |