pub struct Range {
    pub start: u64,
    pub end: u64,
}

Fields§

§start: u64§end: u64

Implementations§

source§

impl Range

source

pub const STRING_SEPARATOR: &'static str = "String_separator"

source

pub const BOUNDARY: &'static str = "boundary"

source

pub const BYTERANGES: &'static str = "byteranges"

source

pub const MULTIPART: &'static str = "multipart"

source

pub const BYTES: &'static str = "bytes"

source

pub const MULTIPART_BYTERANGES_CONTENT_TYPE: &'static str = "multipart/byteranges; boundary=String_separator"

source

pub const _ERROR_NO_EMPTY_LINE_BETWEEN_CONTENT_RANGE_HEADER_AND_BODY: &'static str = "no empty line between content range headers and body"

source

pub const _ERROR_UNABLE_TO_PARSE_CONTENT_RANGE: &'static str = "unable to parse content-range"

source

pub const ERROR_START_IS_AFTER_END_CONTENT_RANGE: &'static str = "start is after end in content range"

source

pub const ERROR_START_IS_BIGGER_THAN_FILESIZE_CONTENT_RANGE: &'static str = "start is bigger than filesize in content range"

source

pub const ERROR_END_IS_BIGGER_THAN_FILESIZE_CONTENT_RANGE: &'static str = "end is bigger than filesize in content range"

source

pub const ERROR_MALFORMED_RANGE_HEADER_WRONG_UNIT: &'static str = "range header malformed, most likely you have an error in unit statement"

source

pub const ERROR_UNABLE_TO_PARSE_RANGE_START: &'static str = "unable to parse range start"

source

pub const ERROR_UNABLE_TO_PARSE_RANGE_END: &'static str = "unable to parse range end"

source

pub fn parse_range_in_content_range( filelength: u64, range_str: &str ) -> Result<Range, Error>

source

pub fn parse_content_range( filepath: &str, filelength: u64, raw_range_value: &str ) -> Result<Vec<ContentRange>, Error>

source

pub fn get_content_range_list( request_uri: &str, range: &Header ) -> Result<Vec<ContentRange>, Error>

source

pub fn _parse_multipart_body( cursor: &mut Cursor<&[u8]>, content_range_list: Vec<ContentRange> ) -> Result<Vec<ContentRange>, String>

source

pub fn _parse_raw_content_range_header_value( unparsed_header_value: &str ) -> Result<(i64, i64, i64), String>

source

pub fn _parse_content_range_header_value( header_value: String ) -> Result<(i64, i64, i64), String>

source

pub fn _parse_line_as_bytes(cursor: &mut Cursor<&[u8]>) -> Vec<u8>

source

pub fn _convert_bytes_array_to_string(buffer: Vec<u8>) -> String

source

pub fn get_content_range(body: Vec<u8>, mime_type: String) -> ContentRange

source

pub fn get_content_range_of_a_file( filepath: &str ) -> Result<ContentRange, String>

source

pub fn parse_multipart_body( cursor: &mut Cursor<&[u8]>, content_range_list: Vec<ContentRange> ) -> Result<Vec<ContentRange>, String>

source

pub fn parse_line_as_bytes( cursor: &mut Cursor<&[u8]> ) -> Result<Vec<u8>, String>

source

pub fn convert_bytes_array_to_string(buffer: Vec<u8>) -> Result<String, String>

Trait Implementations§

source§

impl Clone for Range

source§

fn clone(&self) -> Range

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Range

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq<Range> for Range

source§

fn eq(&self, other: &Range) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for Range

source§

impl StructuralEq for Range

source§

impl StructuralPartialEq for Range

Auto Trait Implementations§

§

impl RefUnwindSafe for Range

§

impl Send for Range

§

impl Sync for Range

§

impl Unpin for Range

§

impl UnwindSafe for Range

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.