pub struct Range {
pub start: u64,
pub end: u64,
}
Fields§
§start: u64
§end: u64
Implementations§
Source§impl Range
impl Range
pub const STRING_SEPARATOR: &'static str = "String_separator"
pub const BOUNDARY: &'static str = "boundary"
pub const BYTERANGES: &'static str = "byteranges"
pub const MULTIPART: &'static str = "multipart"
pub const BYTES: &'static str = "bytes"
pub const MULTIPART_BYTERANGES_CONTENT_TYPE: &'static str = "multipart/byteranges; boundary=String_separator"
pub const _ERROR_NO_EMPTY_LINE_BETWEEN_CONTENT_RANGE_HEADER_AND_BODY: &'static str = "no empty line between content range headers and body"
pub const _ERROR_UNABLE_TO_PARSE_CONTENT_RANGE: &'static str = "unable to parse content-range"
pub const ERROR_START_IS_AFTER_END_CONTENT_RANGE: &'static str = "start is after end in content range"
pub const ERROR_START_IS_BIGGER_THAN_FILESIZE_CONTENT_RANGE: &'static str = "start is bigger than filesize in content range"
pub const ERROR_END_IS_BIGGER_THAN_FILESIZE_CONTENT_RANGE: &'static str = "end is bigger than filesize in content range"
pub const ERROR_MALFORMED_RANGE_HEADER_WRONG_UNIT: &'static str = "range header malformed, most likely you have an error in unit statement"
pub const ERROR_UNABLE_TO_PARSE_RANGE_START: &'static str = "unable to parse range start"
pub const ERROR_UNABLE_TO_PARSE_RANGE_END: &'static str = "unable to parse range end"
pub fn parse_range_in_content_range( filelength: u64, range_str: &str, ) -> Result<Range, Error>
pub fn parse_content_range( filepath: &str, filelength: u64, raw_range_value: &str, ) -> Result<Vec<ContentRange>, Error>
pub fn get_content_range_list( request_uri: &str, range: &Header, ) -> Result<Vec<ContentRange>, Error>
pub fn _parse_multipart_body( cursor: &mut Cursor<&[u8]>, content_range_list: Vec<ContentRange>, ) -> Result<Vec<ContentRange>, String>
pub fn _parse_raw_content_range_header_value( unparsed_header_value: &str, ) -> Result<(i64, i64, i64), String>
pub fn _parse_content_range_header_value( header_value: String, ) -> Result<(i64, i64, i64), String>
pub fn _parse_line_as_bytes(cursor: &mut Cursor<&[u8]>) -> Vec<u8> ⓘ
pub fn _convert_bytes_array_to_string(buffer: Vec<u8>) -> String
pub fn get_content_range(body: Vec<u8>, mime_type: String) -> ContentRange
pub fn get_content_range_of_a_file( filepath: &str, ) -> Result<ContentRange, String>
pub fn parse_multipart_body( cursor: &mut Cursor<&[u8]>, content_range_list: Vec<ContentRange>, ) -> Result<Vec<ContentRange>, String>
pub fn parse_line_as_bytes( cursor: &mut Cursor<&[u8]>, ) -> Result<Vec<u8>, String>
pub fn convert_bytes_array_to_string(buffer: Vec<u8>) -> Result<String, String>
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§
impl Eq for Range
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> 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