Improve documentation on internal types.
This commit is contained in:
parent
a58207aaa9
commit
284e58e8a1
@ -75,3 +75,6 @@ optional = true
|
|||||||
|
|
||||||
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
||||||
instant= { version = "0.1.4", features = ["wasm-bindgen"] } # WASM implementation of std::time::Instant
|
instant= { version = "0.1.4", features = ["wasm-bindgen"] } # WASM implementation of std::time::Instant
|
||||||
|
|
||||||
|
[package.metadata.docs.rs]
|
||||||
|
features = [ "serde", "internals" ]
|
||||||
|
@ -39,6 +39,11 @@ pub type Array = Vec<Dynamic>;
|
|||||||
pub type Map = HashMap<ImmutableString, Dynamic>;
|
pub type Map = HashMap<ImmutableString, Dynamic>;
|
||||||
|
|
||||||
/// A stack of imported modules.
|
/// A stack of imported modules.
|
||||||
|
/// Exported under the `internals` feature only.
|
||||||
|
///
|
||||||
|
/// ## WARNING
|
||||||
|
///
|
||||||
|
/// This type is volatile and may change.
|
||||||
pub type Imports<'a> = Vec<(Cow<'a, str>, Module)>;
|
pub type Imports<'a> = Vec<(Cow<'a, str>, Module)>;
|
||||||
|
|
||||||
#[cfg(not(feature = "unchecked"))]
|
#[cfg(not(feature = "unchecked"))]
|
||||||
@ -190,11 +195,16 @@ impl<T: Into<Dynamic>> From<T> for Target<'_> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// A type that holds all the current states of the Engine.
|
/// A type that holds all the current states of the Engine.
|
||||||
|
/// Exported under the `internals` feature only.
|
||||||
///
|
///
|
||||||
/// # Safety
|
/// # Safety
|
||||||
///
|
///
|
||||||
/// This type uses some unsafe code, mainly for avoiding cloning of local variable names via
|
/// This type uses some unsafe code, mainly for avoiding cloning of local variable names via
|
||||||
/// direct lifetime casting.
|
/// direct lifetime casting.
|
||||||
|
///
|
||||||
|
/// ## WARNING
|
||||||
|
///
|
||||||
|
/// This type is volatile and may change.
|
||||||
#[derive(Debug, Clone, Eq, PartialEq, Hash, Default)]
|
#[derive(Debug, Clone, Eq, PartialEq, Hash, Default)]
|
||||||
pub struct State {
|
pub struct State {
|
||||||
/// Normally, access to variables are parsed with a relative offset into the scope to avoid a lookup.
|
/// Normally, access to variables are parsed with a relative offset into the scope to avoid a lookup.
|
||||||
|
@ -10,7 +10,12 @@ use crate::stdlib::{
|
|||||||
string::{String, ToString},
|
string::{String, ToString},
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Error when tokenizing the script text.
|
/// Error encountered when tokenizing the script text.
|
||||||
|
/// Exported under the `internals` feature only.
|
||||||
|
///
|
||||||
|
/// ## WARNING
|
||||||
|
///
|
||||||
|
/// This type is volatile and may change.
|
||||||
#[derive(Debug, Eq, PartialEq, Clone, Hash)]
|
#[derive(Debug, Eq, PartialEq, Clone, Hash)]
|
||||||
#[non_exhaustive]
|
#[non_exhaustive]
|
||||||
pub enum LexError {
|
pub enum LexError {
|
||||||
|
@ -9,7 +9,9 @@ use crate::token::{is_valid_identifier, Position};
|
|||||||
use crate::utils::{ImmutableString, StaticVec};
|
use crate::utils::{ImmutableString, StaticVec};
|
||||||
use crate::Scope;
|
use crate::Scope;
|
||||||
|
|
||||||
use crate::stdlib::{boxed::Box, convert::TryFrom, fmt, mem, rc::Rc, string::String, sync::Arc};
|
use crate::stdlib::{
|
||||||
|
boxed::Box, convert::TryFrom, fmt, mem, rc::Rc, string::String, sync::Arc, vec::Vec,
|
||||||
|
};
|
||||||
|
|
||||||
/// Trait that maps to `Send + Sync` only under the `sync` feature.
|
/// Trait that maps to `Send + Sync` only under the `sync` feature.
|
||||||
#[cfg(feature = "sync")]
|
#[cfg(feature = "sync")]
|
||||||
|
@ -166,7 +166,7 @@ pub use token::{get_next_token, parse_string_literal, InputStream, Token, Tokeni
|
|||||||
|
|
||||||
#[cfg(feature = "internals")]
|
#[cfg(feature = "internals")]
|
||||||
#[deprecated(note = "this type is volatile and may change")]
|
#[deprecated(note = "this type is volatile and may change")]
|
||||||
pub use parser::{CustomExpr, Expr, ReturnType, ScriptFnDef, Stmt};
|
pub use parser::{CustomExpr, Expr, FloatWrapper, ReturnType, ScriptFnDef, Stmt};
|
||||||
|
|
||||||
#[cfg(feature = "internals")]
|
#[cfg(feature = "internals")]
|
||||||
#[deprecated(note = "this type is volatile and may change")]
|
#[deprecated(note = "this type is volatile and may change")]
|
||||||
|
@ -1129,10 +1129,16 @@ impl Module {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// A chain of module names to qualify a variable or function call.
|
/// A chain of module names to qualify a variable or function call.
|
||||||
/// A `u64` hash key is kept for quick search purposes.
|
/// Exported under the `internals` feature only.
|
||||||
|
///
|
||||||
|
/// A `u64` hash key is cached for quick search purposes.
|
||||||
///
|
///
|
||||||
/// A `StaticVec` is used because most module-level access contains only one level,
|
/// A `StaticVec` is used because most module-level access contains only one level,
|
||||||
/// and it is wasteful to always allocate a `Vec` with one element.
|
/// and it is wasteful to always allocate a `Vec` with one element.
|
||||||
|
///
|
||||||
|
/// ## WARNING
|
||||||
|
///
|
||||||
|
/// This type is volatile and may change.
|
||||||
#[derive(Clone, Eq, PartialEq, Default, Hash)]
|
#[derive(Clone, Eq, PartialEq, Default, Hash)]
|
||||||
pub struct ModuleRef(StaticVec<(String, Position)>, Option<NonZeroUsize>);
|
pub struct ModuleRef(StaticVec<(String, Position)>, Option<NonZeroUsize>);
|
||||||
|
|
||||||
|
@ -342,7 +342,12 @@ impl fmt::Display for FnAccess {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A scripted function definition.
|
/// A type containing information on a scripted function.
|
||||||
|
/// Exported under the `internals` feature only.
|
||||||
|
///
|
||||||
|
/// ## WARNING
|
||||||
|
///
|
||||||
|
/// This type is volatile and may change.
|
||||||
#[derive(Debug, Clone, Hash)]
|
#[derive(Debug, Clone, Hash)]
|
||||||
pub struct ScriptFnDef {
|
pub struct ScriptFnDef {
|
||||||
/// Function name.
|
/// Function name.
|
||||||
@ -376,7 +381,12 @@ impl fmt::Display for ScriptFnDef {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// `return`/`throw` statement.
|
/// A type encapsulating the mode of a `return`/`throw` statement.
|
||||||
|
/// Exported under the `internals` feature only.
|
||||||
|
///
|
||||||
|
/// ## WARNING
|
||||||
|
///
|
||||||
|
/// This type is volatile and may change.
|
||||||
#[derive(Debug, Eq, PartialEq, Clone, Copy, Hash)]
|
#[derive(Debug, Eq, PartialEq, Clone, Copy, Hash)]
|
||||||
pub enum ReturnType {
|
pub enum ReturnType {
|
||||||
/// `return` statement.
|
/// `return` statement.
|
||||||
@ -477,7 +487,8 @@ impl ParseSettings {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A statement.
|
/// A Rhai statement.
|
||||||
|
/// Exported under the `internals` feature only.
|
||||||
///
|
///
|
||||||
/// Each variant is at most one pointer in size (for speed),
|
/// Each variant is at most one pointer in size (for speed),
|
||||||
/// with everything being allocated together in one single tuple.
|
/// with everything being allocated together in one single tuple.
|
||||||
@ -582,6 +593,12 @@ impl Stmt {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// A type wrapping a custom syntax definition.
|
||||||
|
/// Exported under the `internals` feature only.
|
||||||
|
///
|
||||||
|
/// ## WARNING
|
||||||
|
///
|
||||||
|
/// This type is volatile and may change.
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub struct CustomExpr(pub StaticVec<Expr>, pub Shared<FnCustomSyntaxEval>);
|
pub struct CustomExpr(pub StaticVec<Expr>, pub Shared<FnCustomSyntaxEval>);
|
||||||
|
|
||||||
@ -592,11 +609,20 @@ impl fmt::Debug for CustomExpr {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Hash for CustomExpr {
|
impl Hash for CustomExpr {
|
||||||
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
|
fn hash<H: Hasher>(&self, state: &mut H) {
|
||||||
self.0.hash(state);
|
self.0.hash(state);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// A type wrapping a floating-point number.
|
||||||
|
/// Exported under the `internals` feature only.
|
||||||
|
///
|
||||||
|
/// This type is mainly used to provide a standard `Hash` implementation
|
||||||
|
/// to floating-point numbers, allowing `Expr` to derive `Hash` automatically.
|
||||||
|
///
|
||||||
|
/// ## WARNING
|
||||||
|
///
|
||||||
|
/// This type is volatile and may change.
|
||||||
#[cfg(not(feature = "no_float"))]
|
#[cfg(not(feature = "no_float"))]
|
||||||
#[derive(Debug, PartialEq, PartialOrd, Clone)]
|
#[derive(Debug, PartialEq, PartialOrd, Clone)]
|
||||||
pub struct FloatWrapper(pub FLOAT, pub Position);
|
pub struct FloatWrapper(pub FLOAT, pub Position);
|
||||||
@ -609,10 +635,15 @@ impl Hash for FloatWrapper {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// An expression.
|
/// An expression sub-tree.
|
||||||
|
/// Exported under the `internals` feature only.
|
||||||
///
|
///
|
||||||
/// Each variant is at most one pointer in size (for speed),
|
/// Each variant is at most one pointer in size (for speed),
|
||||||
/// with everything being allocated together in one single tuple.
|
/// with everything being allocated together in one single tuple.
|
||||||
|
///
|
||||||
|
/// ## WARNING
|
||||||
|
///
|
||||||
|
/// This type is volatile and may change.
|
||||||
#[derive(Debug, Clone, Hash)]
|
#[derive(Debug, Clone, Hash)]
|
||||||
pub enum Expr {
|
pub enum Expr {
|
||||||
/// Integer constant.
|
/// Integer constant.
|
||||||
|
@ -12,7 +12,8 @@ use crate::token::{is_valid_identifier, Position, Token};
|
|||||||
use crate::utils::StaticVec;
|
use crate::utils::StaticVec;
|
||||||
|
|
||||||
use crate::stdlib::{
|
use crate::stdlib::{
|
||||||
fmt,
|
boxed::Box,
|
||||||
|
fmt, format,
|
||||||
rc::Rc,
|
rc::Rc,
|
||||||
string::{String, ToString},
|
string::{String, ToString},
|
||||||
sync::Arc,
|
sync::Arc,
|
||||||
|
118
src/token.rs
118
src/token.rs
@ -136,89 +136,181 @@ impl fmt::Debug for Position {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Tokens.
|
/// A language token.
|
||||||
|
/// Exported under the `internals` feature only.
|
||||||
|
///
|
||||||
|
/// ## WARNING
|
||||||
|
///
|
||||||
|
/// This type is volatile and may change.
|
||||||
#[derive(Debug, PartialEq, Clone)]
|
#[derive(Debug, PartialEq, Clone)]
|
||||||
pub enum Token {
|
pub enum Token {
|
||||||
|
/// An `INT` constant.
|
||||||
IntegerConstant(INT),
|
IntegerConstant(INT),
|
||||||
|
/// A `FLOAT` constaint.
|
||||||
|
///
|
||||||
|
/// Never appears under the `no_float` feature.
|
||||||
#[cfg(not(feature = "no_float"))]
|
#[cfg(not(feature = "no_float"))]
|
||||||
FloatConstant(FLOAT),
|
FloatConstant(FLOAT),
|
||||||
|
/// An identifier.
|
||||||
Identifier(String),
|
Identifier(String),
|
||||||
|
/// A character constant.
|
||||||
CharConstant(char),
|
CharConstant(char),
|
||||||
|
/// A string constant.
|
||||||
StringConstant(String),
|
StringConstant(String),
|
||||||
|
/// `{`
|
||||||
LeftBrace,
|
LeftBrace,
|
||||||
|
/// `}`
|
||||||
RightBrace,
|
RightBrace,
|
||||||
|
/// `(`
|
||||||
LeftParen,
|
LeftParen,
|
||||||
|
/// `)`
|
||||||
RightParen,
|
RightParen,
|
||||||
|
/// `[`
|
||||||
LeftBracket,
|
LeftBracket,
|
||||||
|
/// `]`
|
||||||
RightBracket,
|
RightBracket,
|
||||||
|
/// `+`
|
||||||
Plus,
|
Plus,
|
||||||
|
/// `+` (unary)
|
||||||
UnaryPlus,
|
UnaryPlus,
|
||||||
|
/// `-`
|
||||||
Minus,
|
Minus,
|
||||||
|
/// `-` (unary)
|
||||||
UnaryMinus,
|
UnaryMinus,
|
||||||
|
/// `*`
|
||||||
Multiply,
|
Multiply,
|
||||||
|
/// `/`
|
||||||
Divide,
|
Divide,
|
||||||
|
/// `%`
|
||||||
Modulo,
|
Modulo,
|
||||||
|
/// `~`
|
||||||
PowerOf,
|
PowerOf,
|
||||||
|
/// `<<`
|
||||||
LeftShift,
|
LeftShift,
|
||||||
|
/// `>>`
|
||||||
RightShift,
|
RightShift,
|
||||||
|
/// `;`
|
||||||
SemiColon,
|
SemiColon,
|
||||||
|
/// `:`
|
||||||
Colon,
|
Colon,
|
||||||
|
/// `::`
|
||||||
DoubleColon,
|
DoubleColon,
|
||||||
|
/// `,`
|
||||||
Comma,
|
Comma,
|
||||||
|
/// `.`
|
||||||
Period,
|
Period,
|
||||||
|
/// `#{`
|
||||||
MapStart,
|
MapStart,
|
||||||
|
/// `=`
|
||||||
Equals,
|
Equals,
|
||||||
|
/// `true`
|
||||||
True,
|
True,
|
||||||
|
/// `false`
|
||||||
False,
|
False,
|
||||||
|
/// `let`
|
||||||
Let,
|
Let,
|
||||||
|
/// `const`
|
||||||
Const,
|
Const,
|
||||||
|
/// `if`
|
||||||
If,
|
If,
|
||||||
|
/// `else`
|
||||||
Else,
|
Else,
|
||||||
|
/// `while`
|
||||||
While,
|
While,
|
||||||
|
/// `loop`
|
||||||
Loop,
|
Loop,
|
||||||
|
/// `for`
|
||||||
For,
|
For,
|
||||||
|
/// `in`
|
||||||
In,
|
In,
|
||||||
|
/// `<`
|
||||||
LessThan,
|
LessThan,
|
||||||
|
/// `>`
|
||||||
GreaterThan,
|
GreaterThan,
|
||||||
|
/// `<=`
|
||||||
LessThanEqualsTo,
|
LessThanEqualsTo,
|
||||||
|
/// `>=`
|
||||||
GreaterThanEqualsTo,
|
GreaterThanEqualsTo,
|
||||||
|
/// `==`
|
||||||
EqualsTo,
|
EqualsTo,
|
||||||
|
/// `!=`
|
||||||
NotEqualsTo,
|
NotEqualsTo,
|
||||||
|
/// `!`
|
||||||
Bang,
|
Bang,
|
||||||
|
/// `|`
|
||||||
Pipe,
|
Pipe,
|
||||||
|
/// `||`
|
||||||
Or,
|
Or,
|
||||||
|
/// `^`
|
||||||
XOr,
|
XOr,
|
||||||
|
/// `&`
|
||||||
Ampersand,
|
Ampersand,
|
||||||
|
/// `&&`
|
||||||
And,
|
And,
|
||||||
|
/// `fn`
|
||||||
|
///
|
||||||
|
/// Never appears under the `no_function` feature.
|
||||||
#[cfg(not(feature = "no_function"))]
|
#[cfg(not(feature = "no_function"))]
|
||||||
Fn,
|
Fn,
|
||||||
|
/// `continue`
|
||||||
Continue,
|
Continue,
|
||||||
|
/// `break`
|
||||||
Break,
|
Break,
|
||||||
|
/// `return`
|
||||||
Return,
|
Return,
|
||||||
|
/// `throw`
|
||||||
Throw,
|
Throw,
|
||||||
|
/// `+=`
|
||||||
PlusAssign,
|
PlusAssign,
|
||||||
|
/// `-=`
|
||||||
MinusAssign,
|
MinusAssign,
|
||||||
|
/// `*=`
|
||||||
MultiplyAssign,
|
MultiplyAssign,
|
||||||
|
/// `/=`
|
||||||
DivideAssign,
|
DivideAssign,
|
||||||
|
/// `<<=`
|
||||||
LeftShiftAssign,
|
LeftShiftAssign,
|
||||||
|
/// `>>=`
|
||||||
RightShiftAssign,
|
RightShiftAssign,
|
||||||
|
/// `&=`
|
||||||
AndAssign,
|
AndAssign,
|
||||||
|
/// `|=`
|
||||||
OrAssign,
|
OrAssign,
|
||||||
|
/// `^=`
|
||||||
XOrAssign,
|
XOrAssign,
|
||||||
|
/// `%=`
|
||||||
ModuloAssign,
|
ModuloAssign,
|
||||||
|
/// `~=`
|
||||||
PowerOfAssign,
|
PowerOfAssign,
|
||||||
|
/// `private`
|
||||||
|
///
|
||||||
|
/// Never appears under the `no_function` feature.
|
||||||
#[cfg(not(feature = "no_function"))]
|
#[cfg(not(feature = "no_function"))]
|
||||||
Private,
|
Private,
|
||||||
|
/// `import`
|
||||||
|
///
|
||||||
|
/// Never appears under the `no_module` feature.
|
||||||
#[cfg(not(feature = "no_module"))]
|
#[cfg(not(feature = "no_module"))]
|
||||||
Import,
|
Import,
|
||||||
|
/// `export`
|
||||||
|
///
|
||||||
|
/// Never appears under the `no_module` feature.
|
||||||
#[cfg(not(feature = "no_module"))]
|
#[cfg(not(feature = "no_module"))]
|
||||||
Export,
|
Export,
|
||||||
|
/// `as`
|
||||||
|
///
|
||||||
|
/// Never appears under the `no_module` feature.
|
||||||
#[cfg(not(feature = "no_module"))]
|
#[cfg(not(feature = "no_module"))]
|
||||||
As,
|
As,
|
||||||
|
/// A lexer error.
|
||||||
LexError(Box<LexError>),
|
LexError(Box<LexError>),
|
||||||
|
/// A comment block.
|
||||||
Comment(String),
|
Comment(String),
|
||||||
|
/// A reserved symbol.
|
||||||
Reserved(String),
|
Reserved(String),
|
||||||
|
/// A custom keyword.
|
||||||
Custom(String),
|
Custom(String),
|
||||||
|
/// End of the input stream.
|
||||||
EOF,
|
EOF,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -566,7 +658,7 @@ impl Token {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Is this token a reserved keyword?
|
/// Is this token a reserved symbol?
|
||||||
pub fn is_reserved(&self) -> bool {
|
pub fn is_reserved(&self) -> bool {
|
||||||
match self {
|
match self {
|
||||||
Self::Reserved(_) => true,
|
Self::Reserved(_) => true,
|
||||||
@ -590,6 +682,11 @@ impl From<Token> for String {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// State of the tokenizer.
|
/// State of the tokenizer.
|
||||||
|
/// Exported under the `internals` feature only.
|
||||||
|
///
|
||||||
|
/// ## WARNING
|
||||||
|
///
|
||||||
|
/// This type is volatile and may change.
|
||||||
#[derive(Debug, Clone, Eq, PartialEq, Default)]
|
#[derive(Debug, Clone, Eq, PartialEq, Default)]
|
||||||
pub struct TokenizeState {
|
pub struct TokenizeState {
|
||||||
/// Maximum length of a string (0 = unlimited).
|
/// Maximum length of a string (0 = unlimited).
|
||||||
@ -605,6 +702,11 @@ pub struct TokenizeState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Trait that encapsulates a peekable character input stream.
|
/// Trait that encapsulates a peekable character input stream.
|
||||||
|
/// Exported under the `internals` feature only.
|
||||||
|
///
|
||||||
|
/// ## WARNING
|
||||||
|
///
|
||||||
|
/// This trait is volatile and may change.
|
||||||
pub trait InputStream {
|
pub trait InputStream {
|
||||||
/// Get the next character
|
/// Get the next character
|
||||||
fn get_next(&mut self) -> Option<char>;
|
fn get_next(&mut self) -> Option<char>;
|
||||||
@ -629,6 +731,11 @@ pub fn is_valid_identifier(name: impl Iterator<Item = char>) -> bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Parse a string literal wrapped by `enclosing_char`.
|
/// Parse a string literal wrapped by `enclosing_char`.
|
||||||
|
/// Exported under the `internals` feature only.
|
||||||
|
///
|
||||||
|
/// ## WARNING
|
||||||
|
///
|
||||||
|
/// This type is volatile and may change.
|
||||||
pub fn parse_string_literal(
|
pub fn parse_string_literal(
|
||||||
stream: &mut impl InputStream,
|
stream: &mut impl InputStream,
|
||||||
state: &mut TokenizeState,
|
state: &mut TokenizeState,
|
||||||
@ -794,7 +901,12 @@ fn scan_comment(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get the next token.
|
/// Get the next token from the `InputStream`.
|
||||||
|
/// Exported under the `internals` feature only.
|
||||||
|
///
|
||||||
|
/// ## WARNING
|
||||||
|
///
|
||||||
|
/// This type is volatile and may change.
|
||||||
pub fn get_next_token(
|
pub fn get_next_token(
|
||||||
stream: &mut impl InputStream,
|
stream: &mut impl InputStream,
|
||||||
state: &mut TokenizeState,
|
state: &mut TokenizeState,
|
||||||
|
@ -92,9 +92,12 @@ pub fn calc_fn_spec<'a>(
|
|||||||
s.finish()
|
s.finish()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A type to hold a number of values in static storage for no-allocation, quick access.
|
/// An array-like type that holds a number of values in static storage for no-allocation, quick access.
|
||||||
|
/// Exported under the `internals` feature only.
|
||||||
|
///
|
||||||
/// If too many items are stored, it converts into using a `Vec`.
|
/// If too many items are stored, it converts into using a `Vec`.
|
||||||
///
|
///
|
||||||
|
///
|
||||||
/// This is essentially a knock-off of the [`staticvec`](https://crates.io/crates/staticvec) crate.
|
/// This is essentially a knock-off of the [`staticvec`](https://crates.io/crates/staticvec) crate.
|
||||||
/// This simplified implementation here is to avoid pulling in another crate.
|
/// This simplified implementation here is to avoid pulling in another crate.
|
||||||
///
|
///
|
||||||
@ -130,6 +133,10 @@ pub fn calc_fn_spec<'a>(
|
|||||||
/// # Safety
|
/// # Safety
|
||||||
///
|
///
|
||||||
/// This type uses some unsafe code (mainly for uninitialized/unused array slots) for efficiency.
|
/// This type uses some unsafe code (mainly for uninitialized/unused array slots) for efficiency.
|
||||||
|
///
|
||||||
|
/// ## WARNING
|
||||||
|
///
|
||||||
|
/// This type is volatile and may change.
|
||||||
//
|
//
|
||||||
// TODO - remove unsafe code
|
// TODO - remove unsafe code
|
||||||
pub struct StaticVec<T> {
|
pub struct StaticVec<T> {
|
||||||
|
Loading…
Reference in New Issue
Block a user