pub struct PresignedRangeDownloadPlan {
pub total_size: Option<u64>,
pub head_url: Option<String>,
pub range_url: String,
pub range_expires_at_unix_secs: Option<u64>,
pub refresh_before_secs: u64,
pub head_headers: HeaderMap,
pub range_headers: HeaderMap,
}Expand description
Provider-neutral presigned range-download plan.
Fields§
§total_size: Option<u64>Known remote object size. When present, download prepare skips HEAD.
head_url: Option<String>Optional dedicated HEAD URL.
range_url: StringURL used for range GET requests.
range_expires_at_unix_secs: Option<u64>Optional range URL expiration timestamp in Unix seconds.
refresh_before_secs: u64Refresh threshold in seconds. Range URL is refreshed before a chunk when
now + refresh_before_secs >= range_expires_at_unix_secs.
head_headers: HeaderMapHeaders added to HEAD requests.
range_headers: HeaderMapHeaders added to range GET requests.
Implementations§
Source§impl PresignedRangeDownloadPlan
impl PresignedRangeDownloadPlan
Sourcepub fn new(range_url: impl Into<String>) -> Self
pub fn new(range_url: impl Into<String>) -> Self
Creates a plan using the same URL for range GET and optional HEAD.
Sourcepub fn with_total_size(self, total_size: u64) -> Self
pub fn with_total_size(self, total_size: u64) -> Self
Sets known remote object size and enables HEAD skipping.
Sourcepub fn with_head_url(self, url: impl Into<String>) -> Self
pub fn with_head_url(self, url: impl Into<String>) -> Self
Sets dedicated HEAD URL.
Sourcepub fn with_range_expires_at_unix_secs(self, expires_at_unix_secs: u64) -> Self
pub fn with_range_expires_at_unix_secs(self, expires_at_unix_secs: u64) -> Self
Sets range URL expiration timestamp in Unix seconds.
Sourcepub fn with_refresh_before_secs(self, secs: u64) -> Self
pub fn with_refresh_before_secs(self, secs: u64) -> Self
Sets range URL refresh threshold in seconds.
Sourcepub fn with_head_headers(self, headers: HeaderMap) -> Self
pub fn with_head_headers(self, headers: HeaderMap) -> Self
Replaces HEAD headers.
Sourcepub fn with_range_headers(self, headers: HeaderMap) -> Self
pub fn with_range_headers(self, headers: HeaderMap) -> Self
Replaces range GET headers.
Trait Implementations§
Source§impl Clone for PresignedRangeDownloadPlan
impl Clone for PresignedRangeDownloadPlan
Source§fn clone(&self) -> PresignedRangeDownloadPlan
fn clone(&self) -> PresignedRangeDownloadPlan
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 moreAuto Trait Implementations§
impl Freeze for PresignedRangeDownloadPlan
impl RefUnwindSafe for PresignedRangeDownloadPlan
impl Send for PresignedRangeDownloadPlan
impl Sync for PresignedRangeDownloadPlan
impl Unpin for PresignedRangeDownloadPlan
impl UnsafeUnpin for PresignedRangeDownloadPlan
impl UnwindSafe for PresignedRangeDownloadPlan
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