pub struct ProgressReader { /* private fields */ }
Methods from Deref<Target = StreamContext>§
Sourcepub fn log_other_write(&mut self, len: usize)
pub fn log_other_write(&mut self, len: usize)
Increase the write count due to a non-payload write.
pub async fn send_transfer_completed(&mut self)
pub async fn send_transfer_aborted(&mut self)
Sourcepub fn notify_payload_write(&mut self, index: u64, offset: u64, len: usize)
pub fn notify_payload_write(&mut self, index: u64, offset: u64, len: usize)
Increase the write count due to a payload write, and notify the progress sender.
index
is the index of the blob in the request.
offset
is the offset in the blob where the write started.
len
is the length of the write.
Sourcepub async fn send_get_request_received(
&self,
hash: &Hash,
ranges: &ChunkRangesSeq,
)
pub async fn send_get_request_received( &self, hash: &Hash, ranges: &ChunkRangesSeq, )
Send a get request received event.
This sends all the required information to make sense of subsequent events such as
Event::TransferStarted
and Event::TransferProgress
.
Sourcepub async fn send_get_many_request_received(
&self,
hashes: &[Hash],
ranges: &ChunkRangesSeq,
)
pub async fn send_get_many_request_received( &self, hashes: &[Hash], ranges: &ChunkRangesSeq, )
Send a get request received event.
This sends all the required information to make sense of subsequent events such as
Event::TransferStarted
and Event::TransferProgress
.
Authorize a push request.
This will send a request to the event sender, and wait for a response if a progress sender is enabled. If not, it will always fail.
We want to make accepting push requests very explicit, since this allows remote nodes to add arbitrary data to our store.
Sourcepub async fn send_transfer_started(&self, index: u64, hash: &Hash, size: u64)
pub async fn send_transfer_started(&self, index: u64, hash: &Hash, size: u64)
Send a transfer started event.