Skip to main content
Glama
liveness.rs855 B
use std::str::FromStr; use thiserror::Error; #[derive(Debug, Error)] #[error("failed to parse '{0}' into LivenessStatus")] pub struct LivenessStatusParseError(String); #[remain::sorted] #[derive(Debug, Eq, Hash, PartialEq)] pub enum LivenessStatus { Ok, } impl LivenessStatus { #[must_use] pub fn as_str(&self) -> &'static str { match self { LivenessStatus::Ok => "ok\n", } } } impl From<LivenessStatus> for &'static str { fn from(value: LivenessStatus) -> Self { value.as_str() } } impl FromStr for LivenessStatus { type Err = LivenessStatusParseError; fn from_str(s: &str) -> Result<Self, Self::Err> { match s.trim().to_lowercase().as_str() { "ok" => Ok(Self::Ok), invalid => Err(LivenessStatusParseError(invalid.to_string())), } } }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/systeminit/si'

If you have feedback or need assistance with the MCP directory API, please join our Discord server