|
17 | 17 | <li>interface <a href="#wasi_cli_terminal_stderr_0_2_4"><code>wasi:cli/terminal-stderr@0.2.4</code></a></li> |
18 | 18 | <li>interface <a href="#wasi_clocks_monotonic_clock_0_2_4"><code>wasi:clocks/monotonic-clock@0.2.4</code></a></li> |
19 | 19 | <li>interface <a href="#wasi_clocks_wall_clock_0_2_4"><code>wasi:clocks/wall-clock@0.2.4</code></a></li> |
| 20 | +<li>interface <a href="#wasi_clocks_timezone_0_2_4"><code>wasi:clocks/timezone@0.2.4</code></a></li> |
20 | 21 | <li>interface <a href="#wasi_filesystem_types_0_2_4"><code>wasi:filesystem/types@0.2.4</code></a></li> |
21 | 22 | <li>interface <a href="#wasi_filesystem_preopens_0_2_4"><code>wasi:filesystem/preopens@0.2.4</code></a></li> |
22 | 23 | <li>interface <a href="#wasi_sockets_network_0_2_4"><code>wasi:sockets/network@0.2.4</code></a></li> |
@@ -708,6 +709,71 @@ also known as <a href="https://en.wikipedia.org/wiki/Unix_time">Unix Time</a>.</ |
708 | 709 | <ul> |
709 | 710 | <li><a id="resolution.0"></a> <a href="#datetime"><a href="#datetime"><code>datetime</code></a></a></li> |
710 | 711 | </ul> |
| 712 | +<h2><a id="wasi_clocks_timezone_0_2_4"></a>Import interface wasi:clocks/timezone@0.2.4</h2> |
| 713 | +<hr /> |
| 714 | +<h3>Types</h3> |
| 715 | +<h4><a id="datetime"></a><code>type datetime</code></h4> |
| 716 | +<p><a href="#datetime"><a href="#datetime"><code>datetime</code></a></a></p> |
| 717 | +<p> |
| 718 | +#### <a id="timezone_display"></a>`record timezone-display` |
| 719 | +<p>Information useful for displaying the timezone of a specific <a href="#datetime"><code>datetime</code></a>.</p> |
| 720 | +<p>This information may vary within a single <code>timezone</code> to reflect daylight |
| 721 | +saving time adjustments.</p> |
| 722 | +<h5>Record Fields</h5> |
| 723 | +<ul> |
| 724 | +<li> |
| 725 | +<p><a id="timezone_display.utc_offset"></a><a href="#utc_offset"><code>utc-offset</code></a>: <code>s32</code></p> |
| 726 | +<p>The number of seconds difference between UTC time and the local |
| 727 | +time of the timezone. |
| 728 | +<p>The returned value will always be less than 86400 which is the |
| 729 | +number of seconds in a day (24<em>60</em>60).</p> |
| 730 | +<p>In implementations that do not expose an actual time zone, this |
| 731 | +should return 0.</p> |
| 732 | +</li> |
| 733 | +<li> |
| 734 | +<p><a id="timezone_display.name"></a><code>name</code>: <code>string</code></p> |
| 735 | +<p>The abbreviated name of the timezone to display to a user. The name |
| 736 | +`UTC` indicates Coordinated Universal Time. Otherwise, this should |
| 737 | +reference local standards for the name of the time zone. |
| 738 | +<p>In implementations that do not expose an actual time zone, this |
| 739 | +should be the string <code>UTC</code>.</p> |
| 740 | +<p>In time zones that do not have an applicable name, a formatted |
| 741 | +representation of the UTC offset may be returned, such as <code>-04:00</code>.</p> |
| 742 | +</li> |
| 743 | +<li> |
| 744 | +<p><a id="timezone_display.in_daylight_saving_time"></a><code>in-daylight-saving-time</code>: <code>bool</code></p> |
| 745 | +<p>Whether daylight saving time is active. |
| 746 | +<p>In implementations that do not expose an actual time zone, this |
| 747 | +should return false.</p> |
| 748 | +</li> |
| 749 | +</ul> |
| 750 | +<hr /> |
| 751 | +<h3>Functions</h3> |
| 752 | +<h4><a id="display"></a><code>display: func</code></h4> |
| 753 | +<p>Return information needed to display the given <a href="#datetime"><code>datetime</code></a>. This includes |
| 754 | +the UTC offset, the time zone name, and a flag indicating whether |
| 755 | +daylight saving time is active.</p> |
| 756 | +<p>If the timezone cannot be determined for the given <a href="#datetime"><code>datetime</code></a>, return a |
| 757 | +<a href="#timezone_display"><code>timezone-display</code></a> for <code>UTC</code> with a <a href="#utc_offset"><code>utc-offset</code></a> of 0 and no daylight |
| 758 | +saving time.</p> |
| 759 | +<h5>Params</h5> |
| 760 | +<ul> |
| 761 | +<li><a id="display.when"></a><code>when</code>: <a href="#datetime"><a href="#datetime"><code>datetime</code></a></a></li> |
| 762 | +</ul> |
| 763 | +<h5>Return values</h5> |
| 764 | +<ul> |
| 765 | +<li><a id="display.0"></a> <a href="#timezone_display"><a href="#timezone_display"><code>timezone-display</code></a></a></li> |
| 766 | +</ul> |
| 767 | +<h4><a id="utc_offset"></a><code>utc-offset: func</code></h4> |
| 768 | +<p>The same as <a href="#display"><code>display</code></a>, but only return the UTC offset.</p> |
| 769 | +<h5>Params</h5> |
| 770 | +<ul> |
| 771 | +<li><a id="utc_offset.when"></a><code>when</code>: <a href="#datetime"><a href="#datetime"><code>datetime</code></a></a></li> |
| 772 | +</ul> |
| 773 | +<h5>Return values</h5> |
| 774 | +<ul> |
| 775 | +<li><a id="utc_offset.0"></a> <code>s32</code></li> |
| 776 | +</ul> |
711 | 777 | <h2><a id="wasi_filesystem_types_0_2_4"></a>Import interface wasi:filesystem/types@0.2.4</h2> |
712 | 778 | <p>WASI filesystem is a filesystem API primarily intended to let users run WASI |
713 | 779 | programs that access their files on their existing filesystems, without |
@@ -1603,7 +1669,10 @@ errors are filesystem-related errors.</p> |
1603 | 1669 | <h2><a id="wasi_sockets_network_0_2_4"></a>Import interface wasi:sockets/network@0.2.4</h2> |
1604 | 1670 | <hr /> |
1605 | 1671 | <h3>Types</h3> |
1606 | | -<h4><a id="network"></a><code>resource network</code></h4> |
| 1672 | +<h4><a id="error"></a><code>type error</code></h4> |
| 1673 | +<p><a href="#error"><a href="#error"><code>error</code></a></a></p> |
| 1674 | +<p> |
| 1675 | +#### <a id="network"></a>`resource network` |
1607 | 1676 | <p>An opaque resource that represents access to (a subset of) the network. |
1608 | 1677 | This enables context-based security for networking. |
1609 | 1678 | There is no need for this to map 1:1 to a physical network interface.</p> |
@@ -1793,6 +1862,25 @@ supported size. |
1793 | 1862 | <li><a id="ip_socket_address.ipv4"></a><code>ipv4</code>: <a href="#ipv4_socket_address"><a href="#ipv4_socket_address"><code>ipv4-socket-address</code></a></a></li> |
1794 | 1863 | <li><a id="ip_socket_address.ipv6"></a><code>ipv6</code>: <a href="#ipv6_socket_address"><a href="#ipv6_socket_address"><code>ipv6-socket-address</code></a></a></li> |
1795 | 1864 | </ul> |
| 1865 | +<hr /> |
| 1866 | +<h3>Functions</h3> |
| 1867 | +<h4><a id="network_error_code"></a><code>network-error-code: func</code></h4> |
| 1868 | +<p>Attempts to extract a network-related <a href="#error_code"><code>error-code</code></a> from the stream |
| 1869 | +<a href="#error"><code>error</code></a> provided.</p> |
| 1870 | +<p>Stream operations which return <a href="#stream_error.last_operation_failed"><code>stream-error::last-operation-failed</code></a> |
| 1871 | +have a payload with more information about the operation that failed. |
| 1872 | +This payload can be passed through to this function to see if there's |
| 1873 | +network-related information about the error to return.</p> |
| 1874 | +<p>Note that this function is fallible because not all stream-related |
| 1875 | +errors are network-related errors.</p> |
| 1876 | +<h5>Params</h5> |
| 1877 | +<ul> |
| 1878 | +<li><a id="network_error_code.err"></a><code>err</code>: borrow<<a href="#error"><a href="#error"><code>error</code></a></a>></li> |
| 1879 | +</ul> |
| 1880 | +<h5>Return values</h5> |
| 1881 | +<ul> |
| 1882 | +<li><a id="network_error_code.0"></a> option<<a href="#error_code"><a href="#error_code"><code>error-code</code></a></a>></li> |
| 1883 | +</ul> |
1796 | 1884 | <h2><a id="wasi_sockets_instance_network_0_2_4"></a>Import interface wasi:sockets/instance-network@0.2.4</h2> |
1797 | 1885 | <p>This interface provides a value-export of the default network handle..</p> |
1798 | 1886 | <hr /> |
|
0 commit comments