pub enum ChunkRejection {
Invalid,
MetadataMismatch,
SenderMismatch,
TooManyTransfers,
SenderQuotaExceeded,
BufferBudgetExhausted,
PreviouslyFailed,
}Expand description
Why FileTransferManager::process_chunk refused a chunk.
Variants§
Invalid
Wire fields are malformed or out of bounds: zero or oversized size claims, empty or oversized data, or bytes exceeding the claimed file size.
MetadataMismatch
Chunk metadata does not match the existing assembly for this file id.
SenderMismatch
Chunk sender does not match the sender that started the assembly.
TooManyTransfers
The global concurrent-assembly cap is reached.
SenderQuotaExceeded
The sender’s concurrent-assembly quota is reached.
BufferBudgetExhausted
Accepting the chunk would exceed the global buffered-bytes budget. The affected assembly is dropped along with the chunk: a dropped chunk is never retransmitted, so the transfer could no longer complete and its buffer would only prolong the exhaustion.
PreviouslyFailed
The chunk belongs to a transfer that already failed (resource drop,
integrity failure, or stale sweep). Its remaining in-flight chunks
are dropped without re-creating assembly state or re-notifying the
application — FileReceiveFailed fires at most once per transfer.
Retries must use a fresh file_id; the failed id is admitted again
only after its tombstone expires (no chunks for the stale timeout).
Implementations§
Source§impl ChunkRejection
impl ChunkRejection
Sourcepub fn is_resource_exhaustion(self) -> bool
pub fn is_resource_exhaustion(self) -> bool
true for rejections caused by receiver resource limits rather than
malformed input — the cases where a well-formed transfer was lost and
the application should be told.
Trait Implementations§
Source§impl Clone for ChunkRejection
impl Clone for ChunkRejection
Source§fn clone(&self) -> ChunkRejection
fn clone(&self) -> ChunkRejection
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ChunkRejection
Source§impl Debug for ChunkRejection
impl Debug for ChunkRejection
impl Eq for ChunkRejection
Source§impl PartialEq for ChunkRejection
impl PartialEq for ChunkRejection
impl StructuralPartialEq for ChunkRejection
Auto Trait Implementations§
impl Freeze for ChunkRejection
impl RefUnwindSafe for ChunkRejection
impl Send for ChunkRejection
impl Sync for ChunkRejection
impl Unpin for ChunkRejection
impl UnsafeUnpin for ChunkRejection
impl UnwindSafe for ChunkRejection
Blanket Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Declassify for T
impl<T> Declassify for T
type Declassified = T
fn declassify(self) -> T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more