Skip to content

Commit

Permalink
feat(cursors/bytes): add BytesCursor::{received_bytes,decoded_bytes}
Browse files Browse the repository at this point in the history
  • Loading branch information
loyd committed Feb 16, 2025
1 parent c50b20d commit c5cf019
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/cursors/bytes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,23 @@ impl BytesCursor {
None => Poll::Ready(Ok(false)),
}
}

/// Returns the total size in bytes received from the CH server since
/// the cursor was created.
///
/// This method counts only size without HTTP headers for now.
/// It can be changed in the future without notice.
#[inline]
pub fn received_bytes(&self) -> u64 {
self.raw.received_bytes()
}

/// Returns the total size in bytes decompressed since the cursor was
/// created.
#[inline]
pub fn decoded_bytes(&self) -> u64 {
self.raw.decoded_bytes()
}
}

impl AsyncRead for BytesCursor {
Expand Down

0 comments on commit c5cf019

Please sign in to comment.