magma-protocol 0.1.34

magma — tfplugin5.proto + tfplugin6.proto bindings via prost-build + tonic-build. The protocol surface every provider speaks; no hand-written gRPC anywhere else.
Documentation
//! magma-protocol — tfplugin5.proto + tfplugin6.proto Rust bindings.
//!
//! The protocol surface every Terraform / OpenTofu provider speaks. Generated
//! at build time by `tonic-build` from the vendored .proto files in `proto/`.
//! No hand-written gRPC anywhere else in magma per `theory/MAGMA.md` §IX
//! anti-patterns.
//!
//! Until proto files are vendored (M0), this crate exposes placeholder
//! modules so dependent crates compile. Once the build script generates
//! the real bindings, uncomment the `include_proto!` invocations below.

/// Marker for which provider-plugin protocol version a `Plugin` speaks.
/// Real gRPC client stubs live under `tfplugin5::*` and `tfplugin6::*`
/// once the build script generates them.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum PluginProtocol {
    /// tfplugin5 — deprecated but still produced by older providers.
    V5,
    /// tfplugin6 — current. Required for sensitive-mark propagation,
    /// nested attribute types, optional-required-computed expression.
    V6,
}

impl PluginProtocol {
    #[must_use]
    pub const fn version_str(self) -> &'static str {
        match self {
            Self::V5 => "5",
            Self::V6 => "6",
        }
    }
}

// Generated at build time from `proto/tfplugin{5,6}.proto`. The .proto
// files are vendored from OpenTofu's `internal/tfplugin{5,6}/` and
// published under MPL-2.0 explicitly for plugin authors to copy.

/// tfplugin5 v5.10 — deprecated but still produced by older providers.
/// Generated by tonic-build from `proto/tfplugin5.proto`.
#[allow(clippy::all)]
#[allow(missing_docs)]
pub mod tfplugin5 {
    tonic::include_proto!("tfplugin5");
}

/// tfplugin6 — current; required for sensitive-mark propagation,
/// nested attribute types, optional-required-computed expression.
/// Generated by tonic-build from `proto/tfplugin6.proto`.
#[allow(clippy::all)]
#[allow(missing_docs)]
pub mod tfplugin6 {
    tonic::include_proto!("tfplugin6");
}