pub struct Range {
pub start: u64,
pub end: Option<u64>,
pub total: Option<u64>,
}Fields§
§start: u64§end: Option<u64>§total: Option<u64>Implementations§
Source§impl Range
impl Range
pub const FULL: Range
pub const FLAC_HEADER: Range
Sourcepub fn new(start: u64, end: Option<u64>) -> Self
pub fn new(start: u64, end: Option<u64>) -> Self
create a new range with given start and end offset
Sourcepub fn length(&self) -> Option<u64>
pub fn length(&self) -> Option<u64>
get the length of the range if the range is full, returns None
Sourcepub fn length_limit(&self, limit: u64) -> u64
pub fn length_limit(&self, limit: u64) -> u64
return length limited by a limit(usually actual file size)
pub fn is_full(&self) -> bool
pub fn contains_flac_header(&self) -> bool
pub fn to_range_header(&self) -> Option<String>
pub fn to_content_range_header(&self) -> String
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Range
impl RefUnwindSafe for Range
impl Send for Range
impl Sync for Range
impl Unpin for Range
impl UnsafeUnpin for Range
impl UnwindSafe for Range
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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