#[non_exhaustive]pub enum RangeOutcome {
Ranges(usize),
Unsatisfiable,
Ignore,
NotBytes,
}Expand description
What to do with a Range request.
§Examples
use parse_net::{byte_ranges, ByteRange, RangeOutcome};
let mut out = [ByteRange { start: 0, end: 0 }; 4];
assert_eq!(byte_ranges(b"bytes=500-", 1000, &mut out)?, RangeOutcome::Ranges(1));
assert_eq!(byte_ranges(b"bytes=1000-", 1000, &mut out)?, RangeOutcome::Unsatisfiable);Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Ranges(usize)
Serve these ranges (206): the first n entries of the output.
Unsatisfiable
No range is satisfiable: answer 416 with Content-Range: bytes */length.
Ignore
Ignore the field and serve the whole representation (200): the set is abusive (too many ranges, too many overlapping, too much out of order) or does not fit the output.
NotBytes
Another range unit: ignore the field and serve the whole representation.
Trait Implementations§
Source§impl Clone for RangeOutcome
impl Clone for RangeOutcome
impl Copy for RangeOutcome
Source§impl Debug for RangeOutcome
impl Debug for RangeOutcome
impl Eq for RangeOutcome
Source§impl Hash for RangeOutcome
impl Hash for RangeOutcome
Source§impl PartialEq for RangeOutcome
impl PartialEq for RangeOutcome
impl StructuralPartialEq for RangeOutcome
Auto Trait Implementations§
impl Freeze for RangeOutcome
impl RefUnwindSafe for RangeOutcome
impl Send for RangeOutcome
impl Sync for RangeOutcome
impl Unpin for RangeOutcome
impl UnsafeUnpin for RangeOutcome
impl UnwindSafe for RangeOutcome
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
Mutably borrows from an owned value. Read more