[Upd] Docs
Some checks failed
CI / checks (push) Failing after 2m33s

This commit is contained in:
Alex 2026-08-19 12:37:22 +02:00
commit a6c4e56835
Signed by: alex
SSH key fingerprint: SHA256:D1+Ub8o0v4K5y1JNivW8IxEOelqLSvPmUzBbDIoZkRQ
14 changed files with 126 additions and 63 deletions

View file

@ -167,6 +167,9 @@ if let Some(writer) = handle.wait().await? {
```rust
// Host
use mtp_transport::{PipeSessionParameters, accept_pipe_session};
use sha2::{Digest, Sha256};
// The streaming digest below requires `sha2` as a direct application dependency.
while let Ok(request) = conn.receive_pipe().await {
if request.description() != "file-upload" {
@ -182,7 +185,7 @@ while let Ok(request) = conn.receive_pipe().await {
let mut reader = accept_pipe_session(
reader.into_inner(), &params, &own_keyring, &client_public_bundle,
).await?;
let mut hasher = sha2::Sha256::new();
let mut hasher = Sha256::new();
while let Some(chunk) = reader.read_record().await? {
hasher.update(&chunk);
process_chunk(&chunk).await?;