Skip to content

Commit

Permalink
[sui-framework] Regenerate sui-framework docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tzakian committed Mar 15, 2024
1 parent 6c59cf4 commit 1920a25
Show file tree
Hide file tree
Showing 70 changed files with 1,871 additions and 59 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

# Module `0x1::address`

Provides a way to get address length since it's a
platform-specific parameter.


- [Function `length`](#0x1_address_length)
Expand All @@ -16,6 +18,8 @@

## Function `length`

Should be converted to a native function.
Current implementation only works for Sui.


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/move-stdlib/address.md#0x1_address_length">length</a>(): u64
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

# Module `0x1::ascii`

The <code>ASCII</code> module defines basic string and char newtypes in Move that verify
that characters are valid ASCII, and that strings consist of only valid ASCII characters.


- [Struct `String`](#0x1_ascii_String)
Expand Down Expand Up @@ -31,6 +33,11 @@

## Struct `String`

The <code><a href="../../dependencies/move-stdlib/ascii.md#0x1_ascii_String">String</a></code> struct holds a vector of bytes that all represent
valid ASCII characters. Note that these ASCII characters may not all
be printable. To determine if a <code><a href="../../dependencies/move-stdlib/ascii.md#0x1_ascii_String">String</a></code> contains only "printable"
characters you should use the <code>all_characters_printable</code> predicate
defined in this module.


<pre><code><b>struct</b> <a href="../../dependencies/move-stdlib/ascii.md#0x1_ascii_String">String</a> <b>has</b> <b>copy</b>, drop, store
Expand Down Expand Up @@ -58,6 +65,7 @@

## Struct `Char`

An ASCII character.


<pre><code><b>struct</b> <a href="../../dependencies/move-stdlib/ascii.md#0x1_ascii_Char">Char</a> <b>has</b> <b>copy</b>, drop, store
Expand Down Expand Up @@ -88,6 +96,7 @@

<a name="0x1_ascii_EINVALID_ASCII_CHARACTER"></a>

An invalid ASCII character was encountered when creating an ASCII string.


<pre><code><b>const</b> <a href="../../dependencies/move-stdlib/ascii.md#0x1_ascii_EINVALID_ASCII_CHARACTER">EINVALID_ASCII_CHARACTER</a>: u64 = 65536;
Expand All @@ -99,6 +108,7 @@

## Function `char`

Convert a <code>byte</code> into a <code><a href="../../dependencies/move-stdlib/ascii.md#0x1_ascii_Char">Char</a></code> that is checked to make sure it is valid ASCII.


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/move-stdlib/ascii.md#0x1_ascii_char">char</a>(byte: u8): <a href="../../dependencies/move-stdlib/ascii.md#0x1_ascii_Char">ascii::Char</a>
Expand All @@ -124,6 +134,8 @@

## Function `string`

Convert a vector of bytes <code>bytes</code> into an <code><a href="../../dependencies/move-stdlib/ascii.md#0x1_ascii_String">String</a></code>. Aborts if
<code>bytes</code> contains non-ASCII characters.


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/move-stdlib/string.md#0x1_string">string</a>(bytes: <a href="../../dependencies/move-stdlib/vector.md#0x1_vector">vector</a>&lt;u8&gt;): <a href="../../dependencies/move-stdlib/ascii.md#0x1_ascii_String">ascii::String</a>
Expand Down Expand Up @@ -153,6 +165,9 @@

## Function `try_string`

Convert a vector of bytes <code>bytes</code> into an <code><a href="../../dependencies/move-stdlib/ascii.md#0x1_ascii_String">String</a></code>. Returns
<code>Some(&lt;ascii_string&gt;)</code> if the <code>bytes</code> contains all valid ASCII
characters. Otherwise returns <code>None</code>.


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/move-stdlib/ascii.md#0x1_ascii_try_string">try_string</a>(bytes: <a href="../../dependencies/move-stdlib/vector.md#0x1_vector">vector</a>&lt;u8&gt;): <a href="../../dependencies/move-stdlib/option.md#0x1_option_Option">option::Option</a>&lt;<a href="../../dependencies/move-stdlib/ascii.md#0x1_ascii_String">ascii::String</a>&gt;
Expand Down Expand Up @@ -184,6 +199,8 @@

## Function `all_characters_printable`

Returns <code><b>true</b></code> if all characters in <code><a href="../../dependencies/move-stdlib/string.md#0x1_string">string</a></code> are printable characters
Returns <code><b>false</b></code> otherwise. Not all <code><a href="../../dependencies/move-stdlib/ascii.md#0x1_ascii_String">String</a></code>s are printable strings.


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/move-stdlib/ascii.md#0x1_ascii_all_characters_printable">all_characters_printable</a>(<a href="../../dependencies/move-stdlib/string.md#0x1_string">string</a>: &<a href="../../dependencies/move-stdlib/ascii.md#0x1_ascii_String">ascii::String</a>): bool
Expand Down Expand Up @@ -287,6 +304,7 @@

## Function `as_bytes`

Get the inner bytes of the <code><a href="../../dependencies/move-stdlib/string.md#0x1_string">string</a></code> as a reference


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/move-stdlib/ascii.md#0x1_ascii_as_bytes">as_bytes</a>(<a href="../../dependencies/move-stdlib/string.md#0x1_string">string</a>: &<a href="../../dependencies/move-stdlib/ascii.md#0x1_ascii_String">ascii::String</a>): &<a href="../../dependencies/move-stdlib/vector.md#0x1_vector">vector</a>&lt;u8&gt;
Expand All @@ -311,6 +329,7 @@

## Function `into_bytes`

Unpack the <code><a href="../../dependencies/move-stdlib/string.md#0x1_string">string</a></code> to get its backing bytes


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/move-stdlib/ascii.md#0x1_ascii_into_bytes">into_bytes</a>(<a href="../../dependencies/move-stdlib/string.md#0x1_string">string</a>: <a href="../../dependencies/move-stdlib/ascii.md#0x1_ascii_String">ascii::String</a>): <a href="../../dependencies/move-stdlib/vector.md#0x1_vector">vector</a>&lt;u8&gt;
Expand All @@ -336,6 +355,7 @@

## Function `byte`

Unpack the <code>char</code> into its underlying byte.


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/move-stdlib/ascii.md#0x1_ascii_byte">byte</a>(char: <a href="../../dependencies/move-stdlib/ascii.md#0x1_ascii_Char">ascii::Char</a>): u8
Expand All @@ -361,6 +381,7 @@

## Function `is_valid_char`

Returns <code><b>true</b></code> if <code>b</code> is a valid ASCII character. Returns <code><b>false</b></code> otherwise.


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/move-stdlib/ascii.md#0x1_ascii_is_valid_char">is_valid_char</a>(b: u8): bool
Expand All @@ -385,6 +406,7 @@

## Function `is_printable_char`

Returns <code><b>true</b></code> if <code>byte</code> is an printable ASCII character. Returns <code><b>false</b></code> otherwise.


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/move-stdlib/ascii.md#0x1_ascii_is_printable_char">is_printable_char</a>(byte: u8): bool
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@

# Module `0x1::bcs`

Utility for converting a Move value to its binary representation in BCS (Binary Canonical
Serialization). BCS is the binary encoding for Move resources and other non-module values
published on-chain. See https://github.com/diem/bcs#binary-canonical-serialization-bcs for more
details on BCS.


- [Function `to_bytes`](#0x1_bcs_to_bytes)
Expand All @@ -16,6 +20,7 @@

## Function `to_bytes`

Return the binary representation of <code>v</code> in BCS (Binary Canonical Serialization) format


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/move-stdlib/bcs.md#0x1_bcs_to_bytes">to_bytes</a>&lt;MoveValue&gt;(v: &MoveValue): <a href="../../dependencies/move-stdlib/vector.md#0x1_vector">vector</a>&lt;u8&gt;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

# Module `0x1::option`

This module defines the Option type and its methods to represent and handle an optional value.


- [Struct `Option`](#0x1_option_Option)
Expand Down Expand Up @@ -35,6 +36,8 @@

## Struct `Option`

Abstraction of a value that may or may not be present. Implemented with a vector of size
zero or one because Move bytecode does not have ADTs.


<pre><code><b>struct</b> <a href="../../dependencies/move-stdlib/option.md#0x1_option_Option">Option</a>&lt;Element&gt; <b>has</b> <b>copy</b>, drop, store
Expand Down Expand Up @@ -65,6 +68,8 @@

<a name="0x1_option_EOPTION_IS_SET"></a>

The <code><a href="../../dependencies/move-stdlib/option.md#0x1_option_Option">Option</a></code> is in an invalid state for the operation attempted.
The <code><a href="../../dependencies/move-stdlib/option.md#0x1_option_Option">Option</a></code> is <code>Some</code> while it should be <code>None</code>.


<pre><code><b>const</b> <a href="../../dependencies/move-stdlib/option.md#0x1_option_EOPTION_IS_SET">EOPTION_IS_SET</a>: u64 = 262144;
Expand All @@ -74,6 +79,8 @@

<a name="0x1_option_EOPTION_NOT_SET"></a>

The <code><a href="../../dependencies/move-stdlib/option.md#0x1_option_Option">Option</a></code> is in an invalid state for the operation attempted.
The <code><a href="../../dependencies/move-stdlib/option.md#0x1_option_Option">Option</a></code> is <code>None</code> while it should be <code>Some</code>.


<pre><code><b>const</b> <a href="../../dependencies/move-stdlib/option.md#0x1_option_EOPTION_NOT_SET">EOPTION_NOT_SET</a>: u64 = 262145;
Expand All @@ -85,6 +92,7 @@

## Function `none`

Return an empty <code><a href="../../dependencies/move-stdlib/option.md#0x1_option_Option">Option</a></code>


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/move-stdlib/option.md#0x1_option_none">none</a>&lt;Element&gt;(): <a href="../../dependencies/move-stdlib/option.md#0x1_option_Option">option::Option</a>&lt;Element&gt;
Expand All @@ -109,6 +117,7 @@

## Function `some`

Return an <code><a href="../../dependencies/move-stdlib/option.md#0x1_option_Option">Option</a></code> containing <code>e</code>


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/move-stdlib/option.md#0x1_option_some">some</a>&lt;Element&gt;(e: Element): <a href="../../dependencies/move-stdlib/option.md#0x1_option_Option">option::Option</a>&lt;Element&gt;
Expand All @@ -133,6 +142,7 @@

## Function `is_none`

Return true if <code>t</code> does not hold a value


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/move-stdlib/option.md#0x1_option_is_none">is_none</a>&lt;Element&gt;(t: &<a href="../../dependencies/move-stdlib/option.md#0x1_option_Option">option::Option</a>&lt;Element&gt;): bool
Expand All @@ -157,6 +167,7 @@

## Function `is_some`

Return true if <code>t</code> holds a value


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/move-stdlib/option.md#0x1_option_is_some">is_some</a>&lt;Element&gt;(t: &<a href="../../dependencies/move-stdlib/option.md#0x1_option_Option">option::Option</a>&lt;Element&gt;): bool
Expand All @@ -181,6 +192,8 @@

## Function `contains`

Return true if the value in <code>t</code> is equal to <code>e_ref</code>
Always returns <code><b>false</b></code> if <code>t</code> does not hold a value


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/move-stdlib/option.md#0x1_option_contains">contains</a>&lt;Element&gt;(t: &<a href="../../dependencies/move-stdlib/option.md#0x1_option_Option">option::Option</a>&lt;Element&gt;, e_ref: &Element): bool
Expand All @@ -205,6 +218,8 @@

## Function `borrow`

Return an immutable reference to the value inside <code>t</code>
Aborts if <code>t</code> does not hold a value


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/move-stdlib/option.md#0x1_option_borrow">borrow</a>&lt;Element&gt;(t: &<a href="../../dependencies/move-stdlib/option.md#0x1_option_Option">option::Option</a>&lt;Element&gt;): &Element
Expand All @@ -230,6 +245,8 @@

## Function `borrow_with_default`

Return a reference to the value inside <code>t</code> if it holds one
Return <code>default_ref</code> if <code>t</code> does not hold a value


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/move-stdlib/option.md#0x1_option_borrow_with_default">borrow_with_default</a>&lt;Element&gt;(t: &<a href="../../dependencies/move-stdlib/option.md#0x1_option_Option">option::Option</a>&lt;Element&gt;, default_ref: &Element): &Element
Expand All @@ -256,6 +273,8 @@

## Function `get_with_default`

Return the value inside <code>t</code> if it holds one
Return <code>default</code> if <code>t</code> does not hold a value


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/move-stdlib/option.md#0x1_option_get_with_default">get_with_default</a>&lt;Element: <b>copy</b>, drop&gt;(t: &<a href="../../dependencies/move-stdlib/option.md#0x1_option_Option">option::Option</a>&lt;Element&gt;, default: Element): Element
Expand Down Expand Up @@ -285,6 +304,8 @@

## Function `fill`

Convert the none option <code>t</code> to a some option by adding <code>e</code>.
Aborts if <code>t</code> already holds a value


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/move-stdlib/option.md#0x1_option_fill">fill</a>&lt;Element&gt;(t: &<b>mut</b> <a href="../../dependencies/move-stdlib/option.md#0x1_option_Option">option::Option</a>&lt;Element&gt;, e: Element)
Expand All @@ -311,6 +332,8 @@

## Function `extract`

Convert a <code>some</code> option to a <code>none</code> by removing and returning the value stored inside <code>t</code>
Aborts if <code>t</code> does not hold a value


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/move-stdlib/option.md#0x1_option_extract">extract</a>&lt;Element&gt;(t: &<b>mut</b> <a href="../../dependencies/move-stdlib/option.md#0x1_option_Option">option::Option</a>&lt;Element&gt;): Element
Expand All @@ -336,6 +359,8 @@

## Function `borrow_mut`

Return a mutable reference to the value inside <code>t</code>
Aborts if <code>t</code> does not hold a value


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/move-stdlib/option.md#0x1_option_borrow_mut">borrow_mut</a>&lt;Element&gt;(t: &<b>mut</b> <a href="../../dependencies/move-stdlib/option.md#0x1_option_Option">option::Option</a>&lt;Element&gt;): &<b>mut</b> Element
Expand All @@ -361,6 +386,8 @@

## Function `swap`

Swap the old value inside <code>t</code> with <code>e</code> and return the old value
Aborts if <code>t</code> does not hold a value


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/move-stdlib/option.md#0x1_option_swap">swap</a>&lt;Element&gt;(t: &<b>mut</b> <a href="../../dependencies/move-stdlib/option.md#0x1_option_Option">option::Option</a>&lt;Element&gt;, e: Element): Element
Expand Down Expand Up @@ -389,6 +416,9 @@

## Function `swap_or_fill`

Swap the old value inside <code>t</code> with <code>e</code> and return the old value;
or if there is no old value, fill it with <code>e</code>.
Different from swap(), swap_or_fill() allows for <code>t</code> not holding a value.


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/move-stdlib/option.md#0x1_option_swap_or_fill">swap_or_fill</a>&lt;Element&gt;(t: &<b>mut</b> <a href="../../dependencies/move-stdlib/option.md#0x1_option_Option">option::Option</a>&lt;Element&gt;, e: Element): <a href="../../dependencies/move-stdlib/option.md#0x1_option_Option">option::Option</a>&lt;Element&gt;
Expand Down Expand Up @@ -417,6 +447,7 @@

## Function `destroy_with_default`

Destroys <code>t.</code> If <code>t</code> holds a value, return it. Returns <code>default</code> otherwise


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/move-stdlib/option.md#0x1_option_destroy_with_default">destroy_with_default</a>&lt;Element: drop&gt;(t: <a href="../../dependencies/move-stdlib/option.md#0x1_option_Option">option::Option</a>&lt;Element&gt;, default: Element): Element
Expand All @@ -443,6 +474,8 @@

## Function `destroy_some`

Unpack <code>t</code> and return its contents
Aborts if <code>t</code> does not hold a value


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/move-stdlib/option.md#0x1_option_destroy_some">destroy_some</a>&lt;Element&gt;(t: <a href="../../dependencies/move-stdlib/option.md#0x1_option_Option">option::Option</a>&lt;Element&gt;): Element
Expand Down Expand Up @@ -471,6 +504,8 @@

## Function `destroy_none`

Unpack <code>t</code>
Aborts if <code>t</code> holds a value


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/move-stdlib/option.md#0x1_option_destroy_none">destroy_none</a>&lt;Element&gt;(t: <a href="../../dependencies/move-stdlib/option.md#0x1_option_Option">option::Option</a>&lt;Element&gt;)
Expand All @@ -497,6 +532,8 @@

## Function `to_vec`

Convert <code>t</code> into a vector of length 1 if it is <code>Some</code>,
and an empty vector otherwise


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/move-stdlib/option.md#0x1_option_to_vec">to_vec</a>&lt;Element&gt;(t: <a href="../../dependencies/move-stdlib/option.md#0x1_option_Option">option::Option</a>&lt;Element&gt;): <a href="../../dependencies/move-stdlib/vector.md#0x1_vector">vector</a>&lt;Element&gt;
Expand Down
Loading

0 comments on commit 1920a25

Please sign in to comment.