silk/buffered_output
Profiles: aarch64-apple-darwin, aarch64-unknown-linux-gnu, aarch64-unknown-linux-gnu-no-libc, wasm32-unknown-unknown, x86_64-unknown-linux-gnu, x86_64-unknown-linux-gnu-no-libc.
Fixed-capacity retained byte output with exact-prefix flushing.
Details
A successful write means this actor owns the reported prefix. Only explicit flush or finish
promises to drive pending bytes to the provider boundary; drop and scope release never flush.
Import as BufferedOutput with import silk.buffered_output { BufferedOutput }.
Public declarations: 1.
BufferedOutput
pub struct BufferedOutputOne fixed-capacity pending output buffer.
Associated function BufferedOutput.make
pub effect<'static> fn make(capacity: usize) -> BufferedOutput ! BufferError | OutOfMemoryError ? &mut AllocatorAllocates and initializes one fixed-capacity output buffer.
Method BufferedOutput.capacity
pub fn capacity<'life0>(self: &'life0 BufferedOutput) -> usizeReturns the immutable fixed capacity.
Method BufferedOutput.pending
pub fn pending<'life0>(self: &'life0 BufferedOutput) -> usizeReturns the retained pending byte count.
Method BufferedOutput.isTerminal
pub fn isTerminal<'life0>(self: &'life0 BufferedOutput) -> boolReports whether a preceding external failure made this output terminal.
Method BufferedOutput.writeSome
pub effect<'env> fn writeSome<'life0: 'env, 'life1: 'env, 'env>(self: &'life0 mut BufferedOutput, input: &'life1 [u8], deadline: silk/option.Option<silk/system_clock.Instant>) -> usize ! BufferError ? &mut ByteDuplex | &mut MonotonicClockAccepts one positive input prefix, writing pending bytes only when space is needed.
Method BufferedOutput.writeAll
pub effect<'env> fn writeAll<'life0: 'env, 'life1: 'env, 'env>(self: &'life0 mut BufferedOutput, input: &'life1 [u8], deadline: silk/option.Option<silk/system_clock.Instant>) -> () ! BufferError ? &mut ByteDuplex | &mut MonotonicClockAccepts the complete finite input or reports its accepted prefix on failure.
Method BufferedOutput.writeVecAll
pub effect<'env> fn writeVecAll<'life0: 'env, 'life1: 'env, 'env>(self: &'life0 mut BufferedOutput, inputs: &'life1 [silk/bytes.Bytes], deadline: silk/option.Option<silk/system_clock.Instant>) -> () ! BufferError ? &mut ByteDuplex | &mut MonotonicClockAccepts borrowed byte vectors in order after checking aggregate length arithmetic.
Method BufferedOutput.flush
pub effect<'life0> fn flush<'life0>(self: &'life0 mut BufferedOutput, deadline: silk/option.Option<silk/system_clock.Instant>) -> () ! BufferError ? &mut ByteDuplex | &mut MonotonicClockWrites every pending byte exactly once, then flushes the provider boundary.
Method BufferedOutput.finish
pub effect<'life0> fn finish<'life0>(self: &'life0 mut BufferedOutput, deadline: silk/option.Option<silk/system_clock.Instant>) -> () ! BufferError ? &mut ByteDuplex | &mut MonotonicClockExplicitly completes pending output; equivalent to flush.
Method BufferedOutput.writeSomeWriter
pub effect<'env> fn writeSomeWriter<'life0: 'env, 'life1: 'env, 'env>(self: &'life0 mut BufferedOutput, input: &'life1 [u8]) -> usize ! BufferError ? &mut WriterAccepts one prefix for a Writer-backed adapter without advertising deadlines.
Method BufferedOutput.writeAllWriter
pub effect<'env> fn writeAllWriter<'life0: 'env, 'life1: 'env, 'env>(self: &'life0 mut BufferedOutput, input: &'life1 [u8]) -> () ! BufferError ? &mut WriterAccepts a complete finite value for a Writer-backed adapter.
Method BufferedOutput.flushWriter
pub effect<'life0> fn flushWriter<'life0>(self: &'life0 mut BufferedOutput) -> () ! BufferError ? &mut WriterWrites the complete pending value through Writer, whose failure has unknown external progress.