stdlib/brotliView source ↗
brotli
43 items · generated by scribe fromstdlib/brotli.fd· synced 2026-11-15
Contents
- brotli_decompress (function)
- brotli_decompress_limit (function)
- brotli_error (function)
- brotli_ok (function)
- brotli_decompress_str (function)
brotli_decompress
Decompress a Brotli stream (Vec of bytes 0..255). Returns the decoded bytes, or an empty Vec when the stream is malformed, truncated, has data after its end, or would decode to more than 256 MB. A valid stream of zero bytes also gives an empty Vec: use brotli_ok or brotli_error to tell the two apart.
pub fn brotli_decompress(data: Vec<i64>) -> Vec<i64> {Parameters:
data:Vec<i64>
Returns: Vec<i64>
Defined at line 1561
brotli_decompress_limit
Like brotli_decompress, with the output capped at max_out bytes (decompression-bomb guard): a stream that decodes to more is an error.
pub fn brotli_decompress_limit(data: Vec<i64>, max_out: i64) -> Vec<i64> {Parameters:
data:Vec<i64>max_out:i64
Returns: Vec<i64>
Defined at line 1568
brotli_error
Why data is not a valid Brotli stream: "" when it is valid (also for a stream that decodes to zero bytes), else a short reason such as “invalid prefix code” or “truncated stream”. Decodes the whole stream.
pub fn brotli_error(data: Vec<i64>) -> str {Parameters:
data:Vec<i64>
Returns: str
Defined at line 1576
brotli_ok
True when data is a complete, valid Brotli stream. This decodes the stream; an empty brotli_decompress result with brotli_ok true is an empty stream, with brotli_ok false an error.
pub fn brotli_ok(data: Vec<i64>) -> bool {Parameters:
data:Vec<i64>
Returns: bool
Defined at line 1584
brotli_decompress_str
Decompress and interpret the result as a string ("" on error). The bytes are taken as they are (UTF-8 stays UTF-8); the string ends at the first zero byte of the output.
pub fn brotli_decompress_str(data: Vec<i64>) -> str {Parameters:
data:Vec<i64>
Returns: str
Defined at line 1591
Generated by scribe, the Fides documentation generator