Enum condow_core::DownloadRange
source · [−]pub enum DownloadRange {
Open(OpenRange),
Closed(ClosedRange),
}Expand description
A range which specifies a download
Conversions for the standard Rust range syntax exist.
Examples
let dl = DownloadRange::from(..);
assert_eq!(dl, DownloadRange::Open(OpenRange::Full));let dl = DownloadRange::from(3..);
assert_eq!(dl, DownloadRange::Open(OpenRange::From(3)));let dl = DownloadRange::from(5..10);
assert_eq!(dl, DownloadRange::Closed(ClosedRange::FromTo(5,10)));let dl = DownloadRange::from(5..=10);
assert_eq!(dl, DownloadRange::Closed(ClosedRange::FromToInclusive(5, 10)));let dl = DownloadRange::from(..7);
assert_eq!(dl, DownloadRange::Closed(ClosedRange::To(7)));let dl = DownloadRange::from(..=7);
assert_eq!(dl, DownloadRange::Closed(ClosedRange::ToInclusive(7)));let dl = DownloadRange::from(InclusiveRange(1, 7));
assert_eq!(dl, DownloadRange::Closed(ClosedRange::FromToInclusive(1,7)));Variants
Open(OpenRange)
Closed(ClosedRange)
Implementations
sourceimpl DownloadRange
impl DownloadRange
pub fn validate(&self) -> Result<(), CondowError>
pub fn sanitized(self) -> Option<Self>
pub fn incl_range_from_size(self, size: u64) -> Option<InclusiveRange>
Trait Implementations
sourceimpl Clone for DownloadRange
impl Clone for DownloadRange
sourcefn clone(&self) -> DownloadRange
fn clone(&self) -> DownloadRange
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for DownloadRange
impl Debug for DownloadRange
sourceimpl Display for DownloadRange
impl Display for DownloadRange
sourceimpl From<InclusiveRange> for DownloadRange
impl From<InclusiveRange> for DownloadRange
sourcefn from(r: InclusiveRange) -> Self
fn from(r: InclusiveRange) -> Self
Converts to this type from the input type.
sourceimpl From<OffsetRange> for DownloadRange
impl From<OffsetRange> for DownloadRange
sourcefn from(r: OffsetRange) -> Self
fn from(r: OffsetRange) -> Self
Converts to this type from the input type.
sourceimpl From<Range<u64>> for DownloadRange
impl From<Range<u64>> for DownloadRange
sourceimpl From<RangeFrom<u64>> for DownloadRange
impl From<RangeFrom<u64>> for DownloadRange
sourceimpl From<RangeFull> for DownloadRange
impl From<RangeFull> for DownloadRange
sourceimpl From<RangeInclusive<u64>> for DownloadRange
impl From<RangeInclusive<u64>> for DownloadRange
sourcefn from(r: RangeInclusive<u64>) -> Self
fn from(r: RangeInclusive<u64>) -> Self
Converts to this type from the input type.
sourceimpl From<RangeTo<u64>> for DownloadRange
impl From<RangeTo<u64>> for DownloadRange
sourceimpl From<RangeToInclusive<u64>> for DownloadRange
impl From<RangeToInclusive<u64>> for DownloadRange
sourcefn from(r: RangeToInclusive<u64>) -> Self
fn from(r: RangeToInclusive<u64>) -> Self
Converts to this type from the input type.
sourceimpl PartialEq<DownloadRange> for DownloadRange
impl PartialEq<DownloadRange> for DownloadRange
sourcefn eq(&self, other: &DownloadRange) -> bool
fn eq(&self, other: &DownloadRange) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourcefn ne(&self, other: &DownloadRange) -> bool
fn ne(&self, other: &DownloadRange) -> bool
This method tests for !=.
impl Copy for DownloadRange
impl StructuralPartialEq for DownloadRange
Auto Trait Implementations
impl RefUnwindSafe for DownloadRange
impl Send for DownloadRange
impl Sync for DownloadRange
impl Unpin for DownloadRange
impl UnwindSafe for DownloadRange
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more