Silk

silk/os_writer

Profiles: aarch64-apple-darwin, aarch64-unknown-linux-gnu, x86_64-unknown-linux-gnu.

Native Writer providers borrowing process standard output and standard error.

When to use

Construct StdoutWriter or StderrWriter at a native application edge and provide it for silk.writer.Writer. Portable code can supply its own Writer provider instead.

Details

Construction makes no foreign call. Writes complete each byte sequence through selected libc descriptor calls. Flush is a no-op because these providers have no userspace buffer.

Gotchas

A failed write may have committed a prefix. Descriptors remain process-owned and are never closed by these providers. The module is empty on WebAssembly and no-libc profiles.

Import as StdoutWriter with import silk.os_writer { StdoutWriter }.

Public declarations: 2.

StdoutWriter

pub struct StdoutWriter

A Writer provider borrowing process standard output without owning or closing its descriptor.

Associated function StdoutWriter.make

pub fn make() -> StdoutWriter

Creates a provider borrowing standard output without making a foreign call.

StderrWriter

pub struct StderrWriter

A Writer provider borrowing process standard error without owning or closing its descriptor.

Associated function StderrWriter.make

pub fn make() -> StderrWriter

Creates a provider borrowing standard error without making a foreign call.

Implementation Writer for StdoutWriter

impl Writer for StdoutWriter

Operation writeAll

writeAll = StdoutWriter.impl@0.writeAll

Operation flush

flush = StdoutWriter.impl@0.flush

Implementation Writer for StderrWriter

impl Writer for StderrWriter

Operation writeAll

writeAll = StderrWriter.impl@1.writeAll

Operation flush

flush = StderrWriter.impl@1.flush

On this page