1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//! Documentation of the `std` subset that the arcis interpreter accepts
//! inside `#[encrypted]` code.
//!
//! # How to read this module
//!
//! Each submodule documents the methods supported on a particular kind of
//! type (`slice`, `iter`, `integer`, `float`, `boolean`, `option`, `cell`,
//! `boxed`, `mem`). For type categories where extension traits work cleanly, the
//! submodule defines a trait whose only purpose is to give rustdoc a page to
//! attach the documentation to; for [`iter`] (where a parallel trait would
//! conflict with [`Iterator`]) the supported methods are listed in the
//! module-level documentation instead.
//!
//! The method bodies are documentation-only stubs that panic if called outside
//! the interpreter. Inside `#[encrypted]` code the interpreter intercepts the
//! call before the body runs.
//!
//! The traits are never imported by user code. Names exist purely so that
//! rustdoc renders pages like [`slice::SupportedSlice`] showing which methods
//! arcis recognizes, on which receivers, with what complexity and caveats.
//!
//! Items defined by arcis itself (`.reveal()`, `.to_arcis()`,
//! `BaseField25519::*`, …) are documented on the types they belong to, not
//! here.
// Order matters: every "stub" submodule (defining a doc-only type like
// `Option`, `Box`, `u8`, …) is declared BEFORE any "mirror" submodule (`clone`,
// `cmp`, …). That way rustdoc encounters the derive-generated std-trait impl
// first (no id suffix) and the doc-only `arcis::std::*::Trait` mirror impl
// second (gets `-1`), keeping the suffix discriminator consistent across
// every type so the sidebar dedup CSS rule works regardless of which type.
// Stubs first (declare types with `#[derive(...)]`). `ops` is here despite also
// defining mirror traits (Add, Sub, Index, …) because it declares the range
// stubs (`Range`, `RangeInclusive`, …) whose derives need to be processed
// before the arcis mirror impls in `clone`/`cmp`/`fmt`/etc. — otherwise the
// `-1` discriminator inverts and the sidebar CSS hides the wrong impl.
// Mirrors second (impl `arcis::std::*::Trait` for the stubs above + arcis types).