//! The `ResolveValue` trait resolves Fluent AST nodes to [`FluentValues`]. //! //! This is an internal API used by [`FluentBundle`] to evaluate Messages, Attributes and other //! AST nodes to [`FluentValues`] which can be then formatted to strings. //! //! [`FluentValues`]: ../types/enum.FluentValue.html //! [`FluentBundle`]: ../bundle/struct.FluentBundle.html mod errors; mod expression; mod inline_expression; mod pattern; mod scope; pub use errors::ResolverError; pub use scope::Scope; use std::borrow::Borrow; use std::fmt; use crate::memoizer::MemoizerKind; use crate::resource::FluentResource; use crate::types::FluentValue; // Converts an AST node to a `FluentValue`. pub(crate) trait ResolveValue { fn resolve<'source, 'errors, R, M: MemoizerKind>( &'source self, scope: &mut Scope<'source, 'errors, R, M>, ) -> FluentValue<'source> where R: Borrow; } pub(crate) trait WriteValue { fn write<'source, 'errors, W, R, M: MemoizerKind>( &'source self, w: &mut W, scope: &mut Scope<'source, 'errors, R, M>, ) -> fmt::Result where W: fmt::Write, R: Borrow; fn write_error(&self, _w: &mut W) -> fmt::Result where W: fmt::Write; }