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

Method new

crates/openshell-router/src/lib.rs:39–48  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

37
38impl Router {
39 pub fn new() -> Result<Self, RouterError> {
40 let client = reqwest::Client::builder()
41 .connect_timeout(Duration::from_secs(30))
42 .build()
43 .map_err(|e| RouterError::Internal(format!("failed to build HTTP client: {e}")))?;
44 Ok(Self {
45 routes: Vec::new(),
46 client,
47 })
48 }
49
50 pub fn from_config(config: &RouterConfig) -> Result<Self, RouterError> {
51 let resolved = config.resolve_routes()?;

Callers

nothing calls this directly

Calls 1

buildMethod · 0.45

Tested by

no test coverage detected