es-fluent 0.18.1

Type-safe Fluent localization derives and runtime traits for Rust applications
Documentation
//! This module provides types for representing FTL variants and type information.

#[doc(hidden)]
pub use es_fluent_shared::registry::__macro;
pub use es_fluent_shared::registry::{
    FtlTypeInfo, FtlVariant, NamespaceRule, StaticFluentArgumentName, StaticFluentDomain,
    StaticFluentEntryId, StaticFluentVariantKey,
};
pub use es_fluent_shared::source::{SourceFile, SourceLine, SourceLocation};

/// A wrapper type for `FtlTypeInfo` that enables inventory collection.
/// This is necessary because `inventory::collect!` requires a type defined
/// in the current crate.
#[derive(Debug)]
pub struct RegisteredFtlType(pub &'static FtlTypeInfo);

// Collect all registered FtlTypeInfo from derive macros
inventory::collect!(RegisteredFtlType);

/// Returns an iterator over all registered FTL type infos.
pub fn get_all_ftl_type_infos() -> impl Iterator<Item = &'static FtlTypeInfo> {
    inventory::iter::<RegisteredFtlType>().map(|r| r.0)
}