Revise documentation.

This commit is contained in:
Stephen Chung
2022-11-29 15:50:58 +08:00
parent 0c85f0c796
commit c509cc896d
11 changed files with 146 additions and 114 deletions

View File

@@ -1,3 +1,4 @@
//! Placeholder settings for [`Engine`]'s limitations.
#![cfg(feature = "unchecked")]
use crate::Engine;
@@ -5,7 +6,7 @@ use crate::Engine;
impl Engine {
/// The maximum levels of function calls allowed for a script.
///
/// Always returns [`usize::MAX`] under `unchecked`.
/// Always returns [`usize::MAX`].
#[inline(always)]
#[must_use]
pub const fn max_call_levels(&self) -> usize {
@@ -13,7 +14,7 @@ impl Engine {
}
/// The maximum number of operations allowed for a script to run (0 for unlimited).
///
/// Always returns zero under `unchecked`.
/// Always returns zero.
#[inline(always)]
#[must_use]
pub const fn max_operations(&self) -> u64 {
@@ -21,7 +22,7 @@ impl Engine {
}
/// The maximum number of imported [modules][crate::Module] allowed for a script.
///
/// Always returns [`usize::MAX`] under `unchecked`.
/// Always returns [`usize::MAX`].
#[inline(always)]
#[must_use]
pub const fn max_modules(&self) -> usize {
@@ -29,7 +30,7 @@ impl Engine {
}
/// The depth limit for expressions (0 for unlimited).
///
/// Always returns zero under `unchecked`.
/// Always returns zero.
#[inline(always)]
#[must_use]
pub const fn max_expr_depth(&self) -> usize {
@@ -37,7 +38,7 @@ impl Engine {
}
/// The depth limit for expressions in functions (0 for unlimited).
///
/// Always returns zero under `unchecked`.
/// Always returns zero.
#[inline(always)]
#[must_use]
pub const fn max_function_expr_depth(&self) -> usize {
@@ -45,7 +46,7 @@ impl Engine {
}
/// The maximum length of [strings][crate::ImmutableString] (0 for unlimited).
///
/// Always returns zero under `unchecked`.
/// Always returns zero.
#[inline(always)]
#[must_use]
pub const fn max_string_size(&self) -> usize {
@@ -53,7 +54,7 @@ impl Engine {
}
/// The maximum length of [arrays][crate::Array] (0 for unlimited).
///
/// Always returns zero under `unchecked`.
/// Always returns zero.
#[inline(always)]
#[must_use]
pub const fn max_array_size(&self) -> usize {
@@ -61,7 +62,7 @@ impl Engine {
}
/// The maximum size of [object maps][crate::Map] (0 for unlimited).
///
/// Always returns zero under `unchecked`.
/// Always returns zero.
#[inline(always)]
#[must_use]
pub const fn max_map_size(&self) -> usize {