pub struct RangeStatus(pub u32);Expand description
The answer to iris.require_range.
Only RangeStatus::SERVED means the bytes are in the buffer the decoder named. For every other
value the buffer has not been written to and holds whatever it held before.
Tuple Fields§
§0: u32Implementations§
Source§impl RangeStatus
impl RangeStatus
Sourcepub const SERVED: Self
pub const SERVED: Self
The bytes are in the buffer, all of them, exactly as many as were asked for.
Sourcepub const OUT_OF_BOUNDS: Self
pub const OUT_OF_BOUNDS: Self
The range runs past the end of the source.
The decoder asked for the wrong thing. This is never a short read, which is the whole reason it is a status rather than a returned length: a decoder that gets fewer bytes than it asked for and does not notice produces an answer that is wrong and looks right.
Sourcepub const TOO_LARGE: Self
pub const TOO_LARGE: Self
No single request to this host can cover a range that long.
The host is reading through a window and the range does not fit in one view of it. Asking again in pieces works, which is what makes this different from the two below.
Sourcepub const UNAVAILABLE: Self
pub const UNAVAILABLE: Self
The host tried and could not get the bytes.
A read that failed, a connection that dropped, a source that contradicted itself. Nothing the decoder does differently will help, and the host already knows the details.
Sourcepub const NO_SOURCE: Self
pub const NO_SOURCE: Self
This host has nothing to serve ranges from.
A decoder that pulls ranges was run by a host that handed it the whole source and did not
expect to be asked, or by one that has not attached a source yet. It is a host bug rather
than a decoder bug, and it is separate from RangeStatus::UNAVAILABLE because the fix is
in a different place.
Trait Implementations§
Source§impl Clone for RangeStatus
impl Clone for RangeStatus
Source§fn clone(&self) -> RangeStatus
fn clone(&self) -> RangeStatus
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more