pub struct Resource {
pub content_range: ContentRange,
pub stream: BoxStream<'static, Result<Bytes>>,
}Expand description
Fields§
§content_range: ContentRangeThe range in bytes available for this resource.
stream: BoxStream<'static, Result<Bytes>>A stream of bytes representing the resource.
Implementations§
Source§impl Resource
impl Resource
Sourcepub fn content_len(&self) -> u64
pub fn content_len(&self) -> u64
The length of the content in bytes in the stream. This may be smaller than the total length of the file.
Sourcepub fn total_len(&self) -> u64
pub fn total_len(&self) -> u64
The total length of the file range in bytes. This may be larger than the bytes in the stream.
pub async fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<(), Error>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Resource
impl !RefUnwindSafe for Resource
impl Send for Resource
impl !Sync for Resource
impl Unpin for Resource
impl UnsafeUnpin for Resource
impl !UnwindSafe for Resource
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<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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