API reference
GDGzipWriter
Incremental gzip output to files, connections, or HTTP response Writers. write returns the accepted input-byte count; flush publishes buffered output; close completes the member; reset discards state and clears errors. Operations are ordered; failures remain sticky until reset. Methods suspend only the calling routine, with explicit _async variants for signals.
Properties
header: Dictionary
Methods
set_header(header: Dictionary) -> voidwrite(data: PackedByteArray) -> int, Errwrite_async(data: PackedByteArray) -> await int, Errflush() -> Variant, Errflush_async() -> await Variant, Errclose() -> Variant, Errclose_async() -> await Variant, Errreset(writer: RefCounted) -> Variant, Errreset_async(writer: RefCounted) -> await Variant, Err
set_header
set_header(header: Dictionary) -> voidSet metadata for the next unstarted member.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
header | Dictionary | Required | Compression metadata configured before the member starts: name, comment, extra, mod_time and os. |
Return value
void
No value is returned.
Errors
This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.
write
write(data: PackedByteArray) -> int, ErrCompress bytes and return the accepted input count.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
data | PackedByteArray | Required | Input data in the representation shown by the parameter type. |
Return value
int, Err
Suspends only the calling routine until the operation completes. No explicit await is needed.
Errors
The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.
write_async
write_async(data: PackedByteArray) -> await int, ErrCompress bytes and return the accepted input count.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
data | PackedByteArray | Required | Input data in the representation shown by the parameter type. |
Return value
await int, Err
Returns a Signal. Use await to receive the completion value shown in the signature.
Errors
The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.
flush
flush() -> Variant, ErrFlush compressed output without ending the member.
Parameters
No parameters.
Return value
Variant, Err
Suspends only the calling routine until the operation completes. No explicit await is needed.
Errors
The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.
flush_async
flush_async() -> await Variant, ErrFlush compressed output without ending the member.
Parameters
No parameters.
Return value
await Variant, Err
Returns a Signal. Use await to receive the completion value shown in the signature.
Errors
The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.
close
close() -> Variant, ErrFinish the member without closing the destination.
Parameters
No parameters.
Return value
Variant, Err
Suspends only the calling routine until the operation completes. No explicit await is needed.
Errors
The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.
close_async
close_async() -> await Variant, ErrFinish the member without closing the destination.
Parameters
No parameters.
Return value
await Variant, Err
Returns a Signal. Use await to receive the completion value shown in the signature.
Errors
The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.
reset
reset(writer: RefCounted) -> Variant, ErrDiscard stream state and reuse the compressor at the same level.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
writer | RefCounted | Required | Byte destination exposing a write operation. |
Return value
Variant, Err
Suspends only the calling routine until the operation completes. No explicit await is needed.
Errors
The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.
reset_async
reset_async(writer: RefCounted) -> await Variant, ErrDiscard stream state and reuse the compressor at the same level.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
writer | RefCounted | Required | Byte destination exposing a write operation. |
Return value
await Variant, Err
Returns a Signal. Use await to receive the completion value shown in the signature.
Errors
The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.