Struct Range

Source
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>

Source

pub fn parse_multipart_body_with_boundary( cursor: &mut Cursor<&[u8]>, content_range_list: Vec<ContentRange>, boundary: String, total_bytes: i32, bytes_read: i32, is_opening_boundary_read: bool, ) -> Result<Vec<ContentRange>, 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 for Range

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

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 StructuralPartialEq for Range

Auto Trait Implementations§

§

impl Freeze for Range

§

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 T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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 T
where 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 T
where T: Clone,

Source§

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 T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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.