Trait Writepub

Source
:trait(pub) Write a o
  .write ( Self a  Self )
  .flush ( Self  Self )
  .finish ( Self  o )
Description

Write — unified sink trait parameterised on the input element type a and an associated output type o returned by .finish. Every writer MUST implement the primitive (Write Self Bytes | Self); blanket impls cascade UTF-8 encoding for Str, Codepoint, and Pattern. .write is all-or-fail: partial writes MUST raise via +eff. .flush defaults to a no-op in the spec; the default body is elided here pending handle impls.

Required Methods

.write ( Self a Self )

Write the entire value or raise via +eff. Returns the handle on success; there is no partial-write return.

.flush ( Self Self )

Push any buffered bytes downstream. Spec default is a no-op; concrete impls override for streaming writers.

.finish ( Self o )

Consume the writer and produce the associated output type.