pub struct StreamResponse {
pub status_code: u16,
pub status_text: &'static str,
pub content_type: &'static str,
pub file_path: PathBuf,
pub offset: u64,
pub content_length: u64,
pub complete_length: u64,
pub etag: String,
pub cache_control: &'static str,
pub content_disposition: Option<String>,
}Expand description
A validated file slice that can be copied to a connection with bounded memory.
§Fields
status_code: Stored field onStreamResponse.status_text: Stored field onStreamResponse.content_type: Stored field onStreamResponse.file_path: Stored field onStreamResponse.offset: Stored field onStreamResponse.content_length: Stored field onStreamResponse.complete_length: Stored field onStreamResponse.etag: Stored field onStreamResponse.cache_control: Stored field onStreamResponse.content_disposition: Stored field onStreamResponse.
§Examples
ⓘ
let _ = std::mem::size_of::<pharos_runtime_static::artifact_server::StreamResponse>();§Related
crate::artifact_serverfor constructors, helpers, and neighboring runtime types.
Fields§
§status_code: u16HTTP status code.
status_text: &'static strHTTP reason phrase.
content_type: &'static strMIME type selected from the trusted asset filename.
file_path: PathBufCanonical file path within the artifact boundary.
offset: u64First byte included in the response.
content_length: u64Number of bytes included in the response.
complete_length: u64Complete file length used by Content-Range.
etag: StringStrong local validator for If-Range.
cache_control: &'static strCache policy selected by the runtime, not the application.
content_disposition: Option<String>Trusted attachment filename for protected downloads.
Trait Implementations§
Source§impl Clone for StreamResponse
impl Clone for StreamResponse
Source§fn clone(&self) -> StreamResponse
fn clone(&self) -> StreamResponse
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StreamResponse
impl Debug for StreamResponse
Source§impl PartialEq for StreamResponse
impl PartialEq for StreamResponse
Source§fn eq(&self, other: &StreamResponse) -> bool
fn eq(&self, other: &StreamResponse) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for StreamResponse
impl StructuralPartialEq for StreamResponse
Auto Trait Implementations§
impl Freeze for StreamResponse
impl RefUnwindSafe for StreamResponse
impl Send for StreamResponse
impl Sync for StreamResponse
impl Unpin for StreamResponse
impl UnsafeUnpin for StreamResponse
impl UnwindSafe for StreamResponse
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.