silk.platform.wasi.descriptor.
Descriptor reads and writes through WASI.
Details#
These operations borrow descriptors. They never close them. They retry interrupted calls and report WASI errno values on failure.
Import as WasiDescriptor with import silk.platform.wasi.descriptor { WasiDescriptor }.
Public declarations: 1.
WasiDescriptor#
pub struct WasiDescriptorDescriptor transfers for WASI providers. Calls never close the descriptor.
Implementation WasiDescriptor#
impl WasiDescriptorAssociated function read#
pub effect fn read(fd: i32, buffer: &mut [u8], count: &mut usize, error: &mut i32) -> boolReads once into buffer. Returns false with a WASI errno on failure.
An empty buffer succeeds without a host call. A zero count means end of input.
Associated function isTerminal#
pub effect fn isTerminal(fd: i32) -> boolReturns false because WASI does not define terminal detection.
Associated function writeAll#
pub effect fn writeAll(fd: i32, buffer: &[u8], error: &mut i32) -> boolWrites all bytes in buffer. A failure can occur after a partial write.
Returns false with the WASI errno, or zero for an invalid host count.
Associated function writeAllGather#
pub effect fn writeAllGather(fd: i32, head: &[u8], rest: &[&[u8]], error: &mut i32) -> boolWrites head followed by all slices of rest. A failure can follow a partial write.
Returns false with a WASI errno, or zero for an invalid host count.
Category: Native platform.
Profiles: wasm32-wasip1, wasm32-wasip2.