fn InputStream::blocking_read(self : InputStream, len : UInt64) -> Result[FixedArray[Byte], StreamError]#deprecated("Use `struct T(A)` to declare a newtype and use `.0` access the underlying type instead.")
fn InputStream::inner(self : InputStream) -> Intfn OutputStream::blocking_splice(self : OutputStream, src : InputStream, len : UInt64) -> Result[UInt64, StreamError]fn OutputStream::blocking_write_and_flush(self : OutputStream, contents : FixedArray[Byte]) -> Result[Unit, StreamError]let pollable = this.subscribe();
while !contents.is_empty() {
// Wait for the stream to become writable
pollable.block();
let Ok(n) = this.check-write(); // eliding error handling
let len = min(n, contents.len());
let (chunk, rest) = contents.split_at(len);
this.write(chunk ); // eliding error handling
contents = rest;
}
this.flush();
// Wait for completion of `flush`
pollable.block();
// Check for any errors that arose during `flush`
let _ = this.check-write(); // eliding error handlingfn OutputStream::blocking_write_zeroes_and_flush(self : OutputStream, len : UInt64) -> Result[Unit, StreamError]let pollable = this.subscribe();
while num_zeroes != 0 {
// Wait for the stream to become writable
pollable.block();
let Ok(n) = this.check-write(); // eliding error handling
let len = min(n, num_zeroes);
this.write-zeroes(len); // eliding error handling
num_zeroes -= len;
}
this.flush();
// Wait for completion of `flush`
pollable.block();
// Check for any errors that arose during `flush`
let _ = this.check-write(); // eliding error handling#deprecated("Use `struct T(A)` to declare a newtype and use `.0` access the underlying type instead.")
fn OutputStream::inner(self : OutputStream) -> Intfn OutputStream::splice(self : OutputStream, src : InputStream, len : UInt64) -> Result[UInt64, StreamError]fn OutputStream::write(self : OutputStream, contents : FixedArray[Byte]) -> Result[Unit, StreamError]Experimental Spin SDK for the MoonBit programming language.
Dependencies