Include decimal in generated docs.

This commit is contained in:
Stephen Chung 2021-02-21 14:26:31 +08:00
parent dd3b16403f
commit 4120e3c88e
4 changed files with 6 additions and 6 deletions

View File

@ -111,4 +111,4 @@ instant= { version = "0.1" } # WASM implementation of std::time::Instant
instant= { version = "0.1" } # WASM implementation of std::time::Instant
[package.metadata.docs.rs]
features = [ "metadata", "internals" ]
features = [ "metadata", "internals", "decimal" ]

View File

@ -1357,10 +1357,10 @@ impl Dynamic {
_ => Err(self.type_name()),
}
}
/// Cast the [`Dynamic`] as a [`Decimal`] and return it.
/// _(DECIMAL)_ Cast the [`Dynamic`] as a [`Decimal`] and return it.
/// Returns the name of the actual type if the cast fails.
///
/// Available only under `decimal`.
/// Exported under the `decimal` feature only.
#[cfg(feature = "decimal")]
#[inline(always)]
pub fn as_decimal(self) -> Result<Decimal, &'static str> {

View File

@ -1738,7 +1738,8 @@ impl Module {
)
}
/// Get an iterator over all script-defined functions in the [`Module`].
/// _(INTERNALS)_ Get an iterator over all script-defined functions in the [`Module`].
/// Exported under the `internals` feature only.
///
/// Function metadata includes:
/// 1) Namespace ([`FnNamespace::Global`] or [`FnNamespace::Internal`]).
@ -1746,7 +1747,6 @@ impl Module {
/// 3) Function name (as string slice).
/// 4) Number of parameters.
/// 5) _(INTERNALS)_ Shared reference to function definition [`ScriptFnDef`][crate::ast::ScriptFnDef].
/// Exported under the `internals` feature only.
#[cfg(not(feature = "no_function"))]
#[cfg(feature = "internals")]
#[inline(always)]

View File

@ -437,7 +437,7 @@ mod f64_functions {
#[cfg(feature = "decimal")]
#[export_module]
mod decimal_functions {
pub mod decimal_functions {
use rust_decimal::{prelude::Zero, Decimal};
#[rhai_fn(skip, return_raw)]