pub struct HttpRange { /* private fields */ }Expand description
Represents an HTTP Range header value for blob operations.
Defines a range of bytes within an HTTP resource, starting at an offset and
ending at offset + length - 1 inclusively. This matches the semantics of .NET’s
Azure.HttpRange.
§Examples
Range of 512 bytes starting at offset 0:
use azure_storage_blob::models::HttpRange;
let range = HttpRange::new(0, 512);
assert_eq!(range.to_string(), "bytes=0-511");Open-ended range starting at offset 255:
use azure_storage_blob::models::HttpRange;
let range = HttpRange::from_offset(255);
assert_eq!(range.to_string(), "bytes=255-");Convert from standard Rust range types:
use azure_storage_blob::models::HttpRange;
let range: HttpRange = (0u64..100).into();
assert_eq!(range.to_string(), "bytes=0-99");
let range: HttpRange = (100u64..).into();
assert_eq!(range.to_string(), "bytes=100-");
let range: HttpRange = (0u64..=99).into();
assert_eq!(range.to_string(), "bytes=0-99");Implementations§
Source§impl HttpRange
impl HttpRange
Sourcepub fn new(offset: u64, length: u64) -> Self
pub fn new(offset: u64, length: u64) -> Self
Creates a new HttpRange with the specified offset and length.
The range will cover bytes from offset to offset + length - 1 inclusive.
§Arguments
offset- The starting byte offset.length- The number of bytes in the range.
Sourcepub fn from_offset(offset: u64) -> Self
pub fn from_offset(offset: u64) -> Self
Creates a new HttpRange that starts at the specified offset and extends to the end.
§Arguments
offset- The starting byte offset.
Trait Implementations§
impl Eq for HttpRange
Source§impl From<HttpRange> for HeaderValue
impl From<HttpRange> for HeaderValue
Source§impl From<RangeInclusive<u64>> for HttpRange
impl From<RangeInclusive<u64>> for HttpRange
Source§fn from(range: RangeInclusive<u64>) -> Self
fn from(range: RangeInclusive<u64>) -> Self
Converts to this type from the input type.
Source§impl From<RangeInclusive<usize>> for HttpRange
impl From<RangeInclusive<usize>> for HttpRange
Source§fn from(range: RangeInclusive<usize>) -> Self
fn from(range: RangeInclusive<usize>) -> Self
Converts to this type from the input type.
Source§impl From<RangeToInclusive<u64>> for HttpRange
impl From<RangeToInclusive<u64>> for HttpRange
Source§fn from(range: RangeToInclusive<u64>) -> Self
fn from(range: RangeToInclusive<u64>) -> Self
Converts to this type from the input type.
Source§impl From<RangeToInclusive<usize>> for HttpRange
impl From<RangeToInclusive<usize>> for HttpRange
Source§fn from(range: RangeToInclusive<usize>) -> Self
fn from(range: RangeToInclusive<usize>) -> Self
Converts to this type from the input type.
impl StructuralPartialEq for HttpRange
Auto Trait Implementations§
impl Freeze for HttpRange
impl RefUnwindSafe for HttpRange
impl Send for HttpRange
impl Sync for HttpRange
impl Unpin for HttpRange
impl UnsafeUnpin for HttpRange
impl UnwindSafe for HttpRange
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ServiceExt for T
impl<T> ServiceExt for T
Source§fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
Apply a transformation to the response body. Read more
Source§fn decompression(self) -> Decompression<Self>where
Self: Sized,
fn decompression(self) -> Decompression<Self>where
Self: Sized,
Decompress response bodies. Read more
Source§fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
High level tracing that classifies responses using HTTP status codes. Read more
Source§fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
High level tracing that classifies responses using gRPC headers. Read more