Skip to content

Commit 52a3366

Browse files
committed
docs: Improve documentation of snippet-trait read_only_algorithm
1 parent 1ae6529 commit 52a3366

File tree

7 files changed

+29
-6
lines changed

7 files changed

+29
-6
lines changed

tasm-lib/src/traits/accessor.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,14 @@ use super::rust_shadow::RustShadow;
2323
/// stack but can only read from memory. Note that it cannot write to static
2424
/// memory. It cannot read from any inputs or write to standard out. It cannot
2525
/// modify the sponge state.
26-
/// See also: [closure], [function], [procedure], [algorithm], [mem_preserver]
26+
/// See also: [closure], [function], [procedure], [algorithm],
27+
/// [read_only_algorithm], [mem_preserver]
2728
///
2829
/// [closure]: crate::traits::closure::Closure
2930
/// [function]: crate::traits::function::Function
3031
/// [procedure]: crate::traits::procedure::Procedure
3132
/// [algorithm]: crate::traits::algorithm::Algorithm
33+
/// [read_only_algorithm]: crate::traits::read_only_algorithm::ReadOnlyAlgorithm
3234
/// [mem_preserver]: crate::traits::mem_preserver::MemPreserver
3335
pub trait Accessor: BasicSnippet {
3436
fn rust_shadow(

tasm-lib/src/traits/algorithm.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,15 @@ use super::rust_shadow::RustShadow;
2323
/// the dynamic memory allocator, and can take nondeterministic input. It cannot read from
2424
/// standard in or write to standard out.
2525
///
26-
/// See also: [closure], [function], [procedure], [accessor], [mem_preserver]
26+
/// See also: [closure], [function], [procedure], [accessor], [mem_preserver],
27+
/// [read_only_algorithm]
2728
///
2829
/// [closure]: crate::traits::closure::Closure
2930
/// [function]: crate::traits::function::Function
3031
/// [procedure]: crate::traits::procedure::Procedure
3132
/// [accessor]: crate::traits::accessor::Accessor
3233
/// [mem_preserver]: crate::traits::mem_preserver::MemPreserver
34+
/// [read_only_algorithm]: crate::traits::read_only_algorithm::ReadOnlyAlgorithm
3335
pub trait Algorithm: BasicSnippet {
3436
fn rust_shadow(
3537
&self,

tasm-lib/src/traits/closure.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,15 @@ use super::rust_shadow::RustShadow;
1818
/// A Closure is a piece of tasm code that modifies the top of the stack without access to
1919
/// memory or nondeterminism or standard input/output.
2020
///
21-
/// See also: [function], [algorithm], [procedure], [accessor], [mem_preserver]
21+
/// See also: [function], [algorithm], [read_only_algorithm], [procedure],
22+
/// [accessor], [mem_preserver]
2223
///
2324
/// [function]: crate::traits::function::Function
2425
/// [algorithm]: crate::traits::algorithm::Algorithm
2526
/// [procedure]: crate::traits::procedure::Procedure
2627
/// [accessor]: crate::traits::accessor::Accessor
2728
/// [mem_preserver]: crate::traits::mem_preserver::MemPreserver
29+
/// [read_only_algorithm]: crate::traits::read_only_algorithm::ReadOnlyAlgorithm
2830
pub trait Closure: BasicSnippet {
2931
fn rust_shadow(&self, stack: &mut Vec<BFieldElement>);
3032

tasm-lib/src/traits/function.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,13 @@ use super::rust_shadow::RustShadow;
2424
/// larger than the dynamic memory allocator and the dynamic memory allocator value has to
2525
/// be updated accordingly.
2626
///
27-
/// See also: [closure], [algorithm], [procedure], [accessor], [mem_preserver]
27+
/// See also: [closure], [algorithm], [read_only_algorithm], [procedure],
28+
/// [accessor], [mem_preserver],
29+
///
2830
///
2931
/// [closure]: crate::traits::closure::Closure
3032
/// [algorithm]: crate::traits::algorithm::Algorithm
33+
/// [read_only_algorithm]: crate::traits::read_only_algorithm::ReadOnlyAlgorithm
3134
/// [procedure]: crate::traits::procedure::Procedure
3235
/// [accessor]: crate::traits::accessor::Accessor
3336
/// [mem_preserver]: crate::traits::mem_preserver::MemPreserver

tasm-lib/src/traits/mem_preserver.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,14 @@ use super::rust_shadow::RustShadow;
2222
/// An MemPreserver is a piece of tasm code that can do pretty much everything
2323
/// except modify memory, including static memory. It can read from any input
2424
/// and write to standard out. It can also modify the sponge state.
25-
/// See also: [closure], [function], [procedure], [algorithm], [accessor]
25+
/// See also: [closure], [function], [procedure], [algorithm],
26+
/// [read_only_algorithm], [accessor]
2627
///
2728
/// [closure]: crate::traits::closure::Closure
2829
/// [function]: crate::traits::function::Function
2930
/// [procedure]: crate::traits::procedure::Procedure
3031
/// [algorithm]: crate::traits::algorithm::Algorithm
32+
/// [read_only_algorithm]: crate::traits::read_only_algorithm::ReadOnlyAlgorithm
3133
/// [accessor]: crate::traits::accessor::Accessor
3234
pub trait MemPreserver: BasicSnippet {
3335
fn rust_shadow(

tasm-lib/src/traits/procedure.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,13 @@ use crate::VmHasher;
3030
/// in a function (lower case f, as in 'labelled scope'); and cannot be proved as
3131
/// a standalone program.
3232
///
33-
/// See also: [closure], [function], [algorithm], [accessor], [mem_preserver]
33+
/// See also: [closure], [function], [algorithm], [read_only_algorithm],
34+
/// [accessor], [mem_preserver]
3435
///
3536
/// [closure]: crate::traits::closure::Closure
3637
/// [function]: crate::traits::function::Function
3738
/// [algorithm]: crate::traits::algorithm::Algorithm
39+
/// [read_only_algorithm]: crate::traits::read_only_algorithm::ReadOnlyAlgorithm
3840
/// [accessor]: crate::traits::accessor::Accessor
3941
/// [mem_preserver]: crate::traits::mem_preserver::MemPreserver
4042
pub trait Procedure: BasicSnippet {

tasm-lib/src/traits/read_only_algorithm.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,16 @@ use super::rust_shadow::RustShadow;
2222
///
2323
/// An ReadOnlyAlgorithm is a piece of tasm code that can read memory and read
2424
/// from non-determinism.
25+
///
26+
/// See also: [closure], [function], [procedure], [accessor], [mem_preserver],
27+
/// [algorithm]
28+
///
29+
/// [closure]: crate::traits::closure::Closure
30+
/// [function]: crate::traits::function::Function
31+
/// [procedure]: crate::traits::procedure::Procedure
32+
/// [accessor]: crate::traits::accessor::Accessor
33+
/// [mem_preserver]: crate::traits::mem_preserver::MemPreserver
34+
/// [algorithm]: crate::traits::algorithm::Algorithm
2535
pub trait ReadOnlyAlgorithm: BasicSnippet {
2636
fn rust_shadow(
2737
&self,

0 commit comments

Comments
 (0)