Struct iroh_blobs::get::progress::TransferState
source · pub struct TransferState {
pub root: BlobState,
pub connected: bool,
pub children: HashMap<NonZeroU64, BlobState>,
pub current: Option<BlobId>,
pub progress_id_to_blob: HashMap<ProgressId, BlobId>,
}
Expand description
Accumulated progress state of a transfer.
Fields§
§root: BlobState
The root blob of this transfer (may be a hash seq),
connected: bool
Whether we are connected to a node
children: HashMap<NonZeroU64, BlobState>
Children if the root blob is a hash seq, empty for raw blobs
current: Option<BlobId>
Child being transferred at the moment.
progress_id_to_blob: HashMap<ProgressId, BlobId>
Progress ids for individual blobs.
Implementations§
source§impl TransferState
impl TransferState
source§impl TransferState
impl TransferState
sourcepub fn get_blob(&self, blob_id: &BlobId) -> Option<&BlobState>
pub fn get_blob(&self, blob_id: &BlobId) -> Option<&BlobState>
Get a blob state by its BlobId
in this transfer.
sourcepub fn get_current(&self) -> Option<&BlobState>
pub fn get_current(&self) -> Option<&BlobState>
Get the blob state currently being transferred.
sourcepub fn on_progress(&mut self, event: DownloadProgress)
pub fn on_progress(&mut self, event: DownloadProgress)
Update the state with a new DownloadProgress
event for this transfer.
Trait Implementations§
source§impl Clone for TransferState
impl Clone for TransferState
source§fn clone(&self) -> TransferState
fn clone(&self) -> TransferState
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for TransferState
impl Debug for TransferState
source§impl<'de> Deserialize<'de> for TransferState
impl<'de> Deserialize<'de> for TransferState
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq for TransferState
impl PartialEq for TransferState
source§fn eq(&self, other: &TransferState) -> bool
fn eq(&self, other: &TransferState) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for TransferState
impl Serialize for TransferState
impl Eq for TransferState
impl StructuralPartialEq for TransferState
Auto Trait Implementations§
impl Freeze for TransferState
impl RefUnwindSafe for TransferState
impl Send for TransferState
impl Sync for TransferState
impl Unpin for TransferState
impl UnwindSafe for TransferState
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more