use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum NoSecret {}
impl Serialize for NoSecret {
fn serialize<S: serde::Serializer>(&self, _serializer: S) -> Result<S::Ok, S::Error> {
match *self {}
}
}
impl<'de> Deserialize<'de> for NoSecret {
fn deserialize<D: serde::Deserializer<'de>>(_deserializer: D) -> Result<Self, D::Error> {
Err(serde::de::Error::custom(
"a credential cannot be enrolled over a connection; enrol it on the host",
))
}
}
#[cfg(feature = "schema")]
impl schemars::JsonSchema for NoSecret {
fn schema_name() -> std::borrow::Cow<'static, str> {
std::borrow::Cow::Borrowed("NoSecret")
}
fn json_schema(_generator: &mut schemars::SchemaGenerator) -> schemars::Schema {
schemars::Schema::from(false)
}
}