pub enum RangeSpec {
From(u64),
FromTo(u64, u64),
Suffix(u64),
}Expand description
One range-spec of a bytes range set.
§Examples
use parse_net::{range, Limits, RangeSpec};
let h = range::parse(b"bytes=0-9, 50-, -5", &Limits::DEFAULT)?;
let specs: Vec<_> = h.specs().collect();
assert_eq!(specs, [RangeSpec::FromTo(0, 9), RangeSpec::From(50), RangeSpec::Suffix(5)]);Variants§
From(u64)
first- : from first to the end.
FromTo(u64, u64)
first-last, both inclusive.
Suffix(u64)
-length: the last length bytes.
Trait Implementations§
impl Copy for RangeSpec
impl Eq for RangeSpec
impl StructuralPartialEq for RangeSpec
Auto Trait Implementations§
impl Freeze for RangeSpec
impl RefUnwindSafe for RangeSpec
impl Send for RangeSpec
impl Sync for RangeSpec
impl Unpin for RangeSpec
impl UnsafeUnpin for RangeSpec
impl UnwindSafe for RangeSpec
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