valinor-wire 0.1.0

Wire protocol and message encoding for MudWorld platform
Documentation
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum ContentType {
    Json,
    Protobuf,
}

impl ContentType {
    pub fn from_header(value: &str) -> Option<Self> {
        match value {
            "application/json" => Some(Self::Json),
            "application/x-protobuf" | "application/protobuf" => Some(Self::Protobuf),
            _ => None,
        }
    }

    pub fn to_header(&self) -> &'static str {
        match self {
            Self::Json => "application/json",
            Self::Protobuf => "application/x-protobuf",
        }
    }
}