Abstract
Abstract
Readonly
settingsThe OutputSettings
used to configure the behavior of output producers
that write to this Output
.
Abstract
asAbstract
bindWrites the code points of the developer-readable [[Debug]] string of the
given object
. Assumes this is a Unicode Output
writer with sufficient
capacity.
the continuation of the output
.
[[OutputException]] if this Output
exits the cont state before
the full debug string has been written.
Writes the code points of the human-readable [[Display]] string of the
given object
. Assumes this is a Unicode Output
writer with sufficient
capacity.
the continuation of the output
.
[[OutputException]] if this Output
exits the cont state before
the full display string has been written.
Abstract
isAbstract
isAbstract
isAbstract
isAbstract
isAbstract
withUpdates the settings
associated with this Output
.
this
Abstract
writeWrites a single token
to the stream, if this Output
is in the
cont state.
this
[[OutputException]] if this Output
is not in the cont state.
Writes the code points of the given string
. Assumes this is a Unicode
Output
writer with sufficient capacity.
this
[[OutputException]] if this Output
exits the cont state before
the full string
has been written.
Writes the code points of the given string
, followed by the code points
of the settings
' [[OutputSettings.lineSeparator line separator].
Assumes this is a Unicode Output
writer with sufficient capacity.
Optional
string: stringthis
[[OutputException]] if this Output
exits the cont state before
the full string
and line separator has been written.
Static
doneStatic
errorStatic
fullGenerated using TypeDoc
Non-blocking token stream writer.
Output
enables incremental, interruptible writing of network protocols and data formats.Output tokens
Output tokens are modeled as primitive numbers, commonly representing Unicode code points, or raw octets; each
Output
implementation specifies the semantic type of its tokens.Output states
An
Output
writer is always in one of three states: _cont_inue, full, or done. The cont state indicates that the stream is ready to write a single token; the full state indicates that the stream is unable to write additional tokens at this time, but that the stream may logically resume at some point in the future; and the done state indicates that the stream has terminated, and that [[bind]] will return the output result. [[isCont]] returnstrue
when in the cont state; [[isFull]] returnstrue
when in the full state; and [[isDone]] returnstrue
when in the done state.Output results
An
Output
writer yields a value of typeT
, obtained via the [[bind]] method, representing some implementation defined result of writing the output. For example, anOutput<string>
implementation may–but is not required to–yield astring
containing all code points written to the output.Non-blocking behavior
Output
writers never block. AnOutput
writer that would otherwise block writing additional output instead enters the full state, signaling the output generator to back off producing the output, but to remain prepared to produce additional output in the future. AnOutput
writer enters the done state when it encounters the final end of its output, signaling to the output generator to stop producing.Output settings
An output generator may alter the tokens it produces based on its
Output
writer's [[settings]]. Uses include pretty printing and styling generated output. [[OutputSettings]] subclasses can provide additional parameters understood by specialized output producers.Cloning
An
Output
writer may be [[clone cloned]] to branch the token stream in an implementation specified manner. Not allOutput
implementations support cloning.See