pub struct ManagedRapServer {
pub config_id: Option<String>,
/* private fields */
}Expand description
A handle to one configured RAP server that the daemon can boot lazily and
shut down at will. Tools hold an Arc to it and call
invoke_endpoint per invocation, so a server
stopped while its session idled reboots transparently on the next call.
Fields§
§config_id: Option<String>Config id (for migration bookkeeping), when present.
Implementations§
Source§impl ManagedRapServer
impl ManagedRapServer
Sourcepub async fn current_base_url(&self) -> Option<String>
pub async fn current_base_url(&self) -> Option<String>
The server’s base URL if it is currently up.
Sourcepub async fn ensure_up(
&self,
) -> Result<ToolsetManifest, Box<dyn Error + Send + Sync>>
pub async fn ensure_up( &self, ) -> Result<ToolsetManifest, Box<dyn Error + Send + Sync>>
Boot the server if it is down and return its manifest (cached for the
lifetime of the boot). If the server boots but its manifest cannot be
fetched, the boot is torn down and the server stays down, so Up
always has a usable manifest.
Sourcepub async fn invoke_endpoint(
&self,
) -> Result<String, Box<dyn Error + Send + Sync>>
pub async fn invoke_endpoint( &self, ) -> Result<String, Box<dyn Error + Send + Sync>>
The invocation endpoint, booting the server first if necessary.
Sourcepub async fn shutdown(&self)
pub async fn shutdown(&self)
Stop the server. Safe to call at any time: the next invocation (or manifest fetch) boots it back up. Only command-based child processes are stopped — RAP servers persist their state keyed by thread ID, so a restart is transparent. MCP servers have no such contract (one may hold state that lives only as long as its process), so MCP proxies are left running; external servers are not ours to stop.