use std::fmt::{Debug, Display, Formatter};
#[derive(Clone, Copy, Eq, PartialEq)]
pub enum GuestDecodeField {
StatusText,
Capability,
BufferObservePath,
BufferEditByteIndex,
BufferEditRange,
BufferEditText,
BufferProposeEditPath,
WorkspaceObservePath,
WorkspaceArtifactWritePath,
WorkspaceArtifactWriteBytes,
StatusPublishPath,
}
impl GuestDecodeField {
#[must_use]
pub const fn as_str(self) -> &'static str {
match self {
Self::StatusText => "status.text",
Self::Capability => "capability",
Self::BufferObservePath => "buffer.observe.path",
Self::BufferEditByteIndex => "buffer.edit.byte_index",
Self::BufferEditRange => "buffer.edit.range",
Self::BufferEditText => "buffer.edit.text",
Self::BufferProposeEditPath => "buffer.propose_edit.path",
Self::WorkspaceObservePath => "workspace.observe.path",
Self::WorkspaceArtifactWritePath => "workspace.artifact_write.path",
Self::WorkspaceArtifactWriteBytes => "workspace.artifact_write.bytes",
Self::StatusPublishPath => "status.publish.path",
}
}
}
impl Display for GuestDecodeField {
fn fmt(&self, formatter: &mut Formatter<'_>) -> std::fmt::Result {
formatter.write_str(self.as_str())
}
}
impl Debug for GuestDecodeField {
fn fmt(&self, formatter: &mut Formatter<'_>) -> std::fmt::Result {
formatter.write_str(self.as_str())
}
}