fulltime-plugin-api 0.1.0

Canonical league-data schema, data-provider WIT interface, and plugin manifest format shared by the FullTime plugin host and data-provider plugins.
Documentation
//! Canonical league-data schema, data-provider WIT interface, and plugin manifest format
//! shared by the `FullTime` plugin host and every data-provider plugin.
//!
//! Neither the host nor any plugin owns this contract: it is versioned and published
//! independently of both so the host and plugins can evolve without a lockstep release.
//! See `openspec/changes/define-league-data-contract/proposal.md` for the full rationale.
//!
//! # Examples
//!
//! ```
//! use fulltime_plugin_api::{Manifest, SCHEMA_VERSION};
//!
//! let source = include_str!("../tests/fixtures/manifest.toml");
//! let manifest = Manifest::parse(source)?;
//! assert!(SCHEMA_VERSION.accepts(manifest.schema_version));
//! # Ok::<(), Box<dyn std::error::Error>>(())
//! ```

#![warn(clippy::pedantic, clippy::nursery, missing_docs, rust_2018_idioms)]
#![deny(unsafe_op_in_unsafe_fn)]
#![forbid(unsafe_code)]

mod bindings;
mod manifest;
mod version;

pub use manifest::{Manifest, ManifestError, ManifestField};
pub use version::{ParseVersionError, Version};

pub use bindings::fulltime::plugin_api::errors::*;
pub use bindings::fulltime::plugin_api::types::*;

/// Current version of the canonical `league-data-schema` (see [`types`
/// interface](https://github.com/pilgrimagesoftware/fulltime-plugin-api/blob/develop/wit/data-provider.wit)).
///
/// A plugin declaring a `schema_version` in its manifest is compatible with a host running
/// this version when `SCHEMA_VERSION.accepts(plugin_schema_version)` is `true` — see
/// [`Version::accepts`].
pub const SCHEMA_VERSION: Version = Version::new(1, 0);

/// Current version of the `data-provider` WIT interface.
///
/// A plugin declaring an `interface_version` in its manifest is compatible with a host
/// running this version when `INTERFACE_VERSION.accepts(plugin_interface_version)` is
/// `true` — see [`Version::accepts`].
pub const INTERFACE_VERSION: Version = Version::new(1, 0);