Zakir032002 opened a new pull request, #3340: URL: https://github.com/apache/fory/pull/3340
## What does this PR do? Implements streaming deserialization for Rust, aligned with C++ PR #3307 stream model. Closes #3300 ## Changes ### New: `fory-core/src/stream.rs` - `ForyStreamBuf`: growable buffer wrapping `dyn Read`, no compaction (matches C++ `ForyInputStreamBuf`) - `fill_buffer(min_bytes)`: reads from source in a loop until enough data is available ### Modified: `fory-core/src/buffer.rs` - Made `Reader` stream-aware with optional `ForyStreamBuf` field - Added `from_stream()` / `from_stream_with_capacity()` constructors - Added `ensure_readable(N)` before every read and `sync_stream_pos()` after every cursor advance - Added byte-at-a-time varint fallbacks for stream-backed readers - In-memory fast path unchanged (zero overhead) ### Modified: `fory-core/src/fory.rs` - Fixed `deserialize_from` to transfer stream state via take/restore pattern ### New: `tests/tests/test_stream.rs` 12 tests covering all requirements from #3300: - Buffer-level: primitives, short read error, small types, floats, bytes/skip - Fory-level: primitive, string, struct, sequential, truncated, Vec roundtrip - Regression: in-memory path unchanged ## Verification - `cargo clippy --all-targets --all-features -- -D warnings` passes - `cargo fmt --check` passes - `cargo test --all` passes (no regressions) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
