File: error.wit

package info (click to toggle)
rust-wasmtime 26.0.1%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 48,492 kB
  • sloc: ansic: 4,003; sh: 561; javascript: 542; cpp: 254; asm: 175; ml: 96; makefile: 55
file content (34 lines) | stat: -rw-r--r-- 1,506 bytes parent folder | download | duplicates (2)
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
package wasi:io@0.2.1;

@since(version = 0.2.0)
interface error {
    /// A resource which represents some error information.
    ///
    /// The only method provided by this resource is `to-debug-string`,
    /// which provides some human-readable information about the error.
    ///
    /// In the `wasi:io` package, this resource is returned through the
    /// `wasi:io/streams/stream-error` type.
    ///
    /// To provide more specific error information, other interfaces may
    /// offer functions to "downcast" this error into more specific types. For example,
    /// errors returned from streams derived from filesystem types can be described using
    /// the filesystem's own error-code type. This is done using the function
    /// `wasi:filesystem/types/filesystem-error-code`, which takes a `borrow<error>`
    /// parameter and returns an `option<wasi:filesystem/types/error-code>`.
    ///
    /// The set of functions which can "downcast" an `error` into a more
    /// concrete type is open.
    @since(version = 0.2.0)
    resource error {
        /// Returns a string that is suitable to assist humans in debugging
        /// this error.
        ///
        /// WARNING: The returned string should not be consumed mechanically!
        /// It may change across platforms, hosts, or other implementation
        /// details. Parsing this string is a major platform-compatibility
        /// hazard.
        @since(version = 0.2.0)
        to-debug-string: func() -> string;
    }
}