@@ -46,13 +46,13 @@ pub effect Stdin {
4646
4747``` wado
4848pub effect Stdout {
49- async fn write_via_stream(data: Stream<u8>) -> Result<(), ErrorCode>;
49+ fn write_via_stream(data: Stream<u8>) -> Future< Result<(), ErrorCode> >;
5050}
5151```
5252
5353``` wado
5454pub effect Stderr {
55- async fn write_via_stream(data: Stream<u8>) -> Result<(), ErrorCode>;
55+ fn write_via_stream(data: Stream<u8>) -> Future< Result<(), ErrorCode> >;
5656}
5757```
5858
@@ -123,60 +123,6 @@ pub flags OpenFlags {
123123
124124### Enums
125125
126- ``` wado
127- pub enum DescriptorType {
128- Unknown,
129- BlockDevice,
130- CharacterDevice,
131- Directory,
132- Fifo,
133- SymbolicLink,
134- RegularFile,
135- Socket,
136- }
137- ```
138-
139- ``` wado
140- pub enum ErrorCode {
141- Access,
142- Already,
143- BadDescriptor,
144- Busy,
145- Deadlock,
146- Quota,
147- Exist,
148- FileTooLarge,
149- IllegalByteSequence,
150- InProgress,
151- Interrupted,
152- Invalid,
153- Io,
154- IsDirectory,
155- Loop,
156- TooManyLinks,
157- MessageSize,
158- NameTooLong,
159- NoDevice,
160- NoEntry,
161- NoLock,
162- InsufficientMemory,
163- InsufficientSpace,
164- NotDirectory,
165- NotEmpty,
166- NotRecoverable,
167- Unsupported,
168- NoTty,
169- NoSuchDevice,
170- Overflow,
171- NotPermitted,
172- Pipe,
173- ReadOnly,
174- InvalidSeek,
175- TextFileBusy,
176- CrossDevice,
177- }
178- ```
179-
180126``` wado
181127pub enum Advice {
182128 Normal,
@@ -201,15 +147,15 @@ pub effect Preopens {
201147``` wado
202148pub resource Descriptor {
203149 fn read_via_stream(self: &Descriptor, offset: Filesize) -> [Stream<u8>, Future<Result<(), ErrorCode>>];
204- async fn write_via_stream(self: &Descriptor, data: Stream<u8>, offset: Filesize) -> Result<(), ErrorCode>;
205- async fn append_via_stream(self: &Descriptor, data: Stream<u8>) -> Result<(), ErrorCode>;
150+ fn write_via_stream(self: &Descriptor, data: Stream<u8>, offset: Filesize) -> Future< Result<(), ErrorCode> >;
151+ fn append_via_stream(self: &Descriptor, data: Stream<u8>) -> Future< Result<(), ErrorCode> >;
206152 async fn advise(self: &Descriptor, offset: Filesize, length: Filesize, advice: Advice) -> Result<(), ErrorCode>;
207153 async fn sync_data(self: &Descriptor) -> Result<(), ErrorCode>;
208154 async fn get_flags(self: &Descriptor) -> Result<DescriptorFlags, ErrorCode>;
209155 async fn get_type(self: &Descriptor) -> Result<DescriptorType, ErrorCode>;
210156 async fn set_size(self: &Descriptor, size: Filesize) -> Result<(), ErrorCode>;
211157 async fn set_times(self: &Descriptor, data_access_timestamp: NewTimestamp, data_modification_timestamp: NewTimestamp) -> Result<(), ErrorCode>;
212- async fn read_directory(self: &Descriptor) -> [Stream<DirectoryEntry>, Future<Result<(), ErrorCode>>];
158+ fn read_directory(self: &Descriptor) -> [Stream<DirectoryEntry>, Future<Result<(), ErrorCode>>];
213159 async fn sync(self: &Descriptor) -> Result<(), ErrorCode>;
214160 async fn create_directory_at(self: &Descriptor, path: String) -> Result<(), ErrorCode>;
215161 async fn stat(self: &Descriptor) -> Result<DescriptorStat, ErrorCode>;
@@ -257,6 +203,19 @@ pub struct MetadataHashValue {
257203
258204### Variants
259205
206+ ``` wado
207+ pub variant DescriptorType {
208+ BlockDevice,
209+ CharacterDevice,
210+ Directory,
211+ Fifo,
212+ SymbolicLink,
213+ RegularFile,
214+ Socket,
215+ Other(Option<String>),
216+ }
217+ ```
218+
260219``` wado
261220pub variant NewTimestamp {
262221 NoChange,
@@ -265,6 +224,48 @@ pub variant NewTimestamp {
265224}
266225```
267226
227+ ``` wado
228+ pub variant ErrorCode {
229+ Access,
230+ Already,
231+ BadDescriptor,
232+ Busy,
233+ Deadlock,
234+ Quota,
235+ Exist,
236+ FileTooLarge,
237+ IllegalByteSequence,
238+ InProgress,
239+ Interrupted,
240+ Invalid,
241+ Io,
242+ IsDirectory,
243+ Loop,
244+ TooManyLinks,
245+ MessageSize,
246+ NameTooLong,
247+ NoDevice,
248+ NoEntry,
249+ NoLock,
250+ InsufficientMemory,
251+ InsufficientSpace,
252+ NotDirectory,
253+ NotEmpty,
254+ NotRecoverable,
255+ Unsupported,
256+ NoTty,
257+ NoSuchDevice,
258+ Overflow,
259+ NotPermitted,
260+ Pipe,
261+ ReadOnly,
262+ InvalidSeek,
263+ TextFileBusy,
264+ CrossDevice,
265+ Other(Option<String>),
266+ }
267+ ```
268+
268269## wasi: http
269270
270271### Types
@@ -445,13 +446,16 @@ pub variant HeaderError {
445446 InvalidSyntax,
446447 Forbidden,
447448 Immutable,
449+ SizeExceeded,
450+ Other(Option<String>),
448451}
449452```
450453
451454``` wado
452455pub variant RequestOptionsError {
453456 NotSupported,
454457 Immutable,
458+ Other(Option<String>),
455459}
456460```
457461
@@ -511,14 +515,14 @@ pub effect InsecureSeed {
511515
512516``` wado
513517pub effect Insecure {
514- fn get_insecure_random_bytes(len : u64) -> Array<u8>;
518+ fn get_insecure_random_bytes(max_len : u64) -> Array<u8>;
515519 fn get_insecure_random_u64() -> u64;
516520}
517521```
518522
519523``` wado
520524pub effect Random {
521- fn get_random_bytes(len : u64) -> Array<u8>;
525+ fn get_random_bytes(max_len : u64) -> Array<u8>;
522526 fn get_random_u64() -> u64;
523527}
524528```
@@ -534,43 +538,13 @@ pub type Ipv6Address = [u16, u16, u16, u16, u16, u16, u16, u16];
534538
535539### Enums
536540
537- ``` wado
538- pub enum ErrorCode {
539- Unknown,
540- AccessDenied,
541- NotSupported,
542- InvalidArgument,
543- OutOfMemory,
544- Timeout,
545- InvalidState,
546- AddressNotBindable,
547- AddressInUse,
548- RemoteUnreachable,
549- ConnectionRefused,
550- ConnectionReset,
551- ConnectionAborted,
552- DatagramTooLarge,
553- }
554- ```
555-
556541``` wado
557542pub enum IpAddressFamily {
558543 Ipv4,
559544 Ipv6,
560545}
561546```
562547
563- ``` wado
564- pub enum ErrorCode {
565- Unknown,
566- AccessDenied,
567- InvalidArgument,
568- NameUnresolvable,
569- TemporaryResolverFailure,
570- PermanentResolverFailure,
571- }
572- ```
573-
574548### Effects
575549
576550``` wado
@@ -587,7 +561,7 @@ pub resource TcpSocket {
587561 fn bind(self: &TcpSocket, local_address: IpSocketAddress) -> Result<(), ErrorCode>;
588562 async fn connect(self: &TcpSocket, remote_address: IpSocketAddress) -> Result<(), ErrorCode>;
589563 fn listen(self: &TcpSocket) -> Result<Stream<TcpSocket>, ErrorCode>;
590- async fn send(self: &TcpSocket, data: Stream<u8>) -> Result<(), ErrorCode>;
564+ fn send(self: &TcpSocket, data: Stream<u8>) -> Future< Result<(), ErrorCode> >;
591565 fn receive(self: &TcpSocket) -> [Stream<u8>, Future<Result<(), ErrorCode>>];
592566 fn get_local_address(self: &TcpSocket) -> Result<IpSocketAddress, ErrorCode>;
593567 fn get_remote_address(self: &TcpSocket) -> Result<IpSocketAddress, ErrorCode>;
@@ -651,6 +625,26 @@ pub struct Ipv6SocketAddress {
651625
652626### Variants
653627
628+ ``` wado
629+ pub variant ErrorCode {
630+ AccessDenied,
631+ NotSupported,
632+ InvalidArgument,
633+ OutOfMemory,
634+ Timeout,
635+ InvalidState,
636+ AddressNotBindable,
637+ AddressInUse,
638+ RemoteUnreachable,
639+ ConnectionRefused,
640+ ConnectionBroken,
641+ ConnectionReset,
642+ ConnectionAborted,
643+ DatagramTooLarge,
644+ Other(Option<String>),
645+ }
646+ ```
647+
654648``` wado
655649pub variant IpAddress {
656650 Ipv4(Ipv4Address),
@@ -664,3 +658,14 @@ pub variant IpSocketAddress {
664658 Ipv6(Ipv6SocketAddress),
665659}
666660```
661+
662+ ``` wado
663+ pub variant ErrorCode {
664+ AccessDenied,
665+ InvalidArgument,
666+ NameUnresolvable,
667+ TemporaryResolverFailure,
668+ PermanentResolverFailure,
669+ Other(Option<String>),
670+ }
671+ ```
0 commit comments