alma 0.1.1

A Bevy-native modal text editor with Vim-style navigation.
Documentation
//! Current WIT-world proof for enabled plugin config.

use crate::plugin::CURRENT_WIT_WORLD;
use std::fmt::{Debug, Formatter};

/// Proof that an enabled plugin targets the current plugin WIT world.
#[derive(Clone, Copy, Eq, Hash, PartialEq)]
pub(in crate::plugin) struct PluginWitWorld(());

impl PluginWitWorld {
    /// Returns the current supported WIT world proof.
    #[must_use]
    pub const fn current() -> Self {
        Self(())
    }

    /// Stable ABI string used by config, manifests, and bindings.
    #[must_use]
    pub const fn as_str(self) -> &'static str {
        match self {
            Self(()) => CURRENT_WIT_WORLD,
        }
    }
}

impl Debug for PluginWitWorld {
    fn fmt(&self, formatter: &mut Formatter<'_>) -> std::fmt::Result {
        self.as_str().fmt(formatter)
    }
}