pub struct StorageUrlConfig {
pub default_expires_in: Duration,
pub max_expires_in: Duration,
}Expand description
Configuration for storage URL generation
Fields§
§default_expires_in: DurationDefault expiration time for presigned URLs
max_expires_in: DurationMaximum expiration time allowed
Implementations§
Source§impl StorageUrlConfig
impl StorageUrlConfig
Sourcepub fn validate_expires_in(&self, requested: Duration) -> Duration
pub fn validate_expires_in(&self, requested: Duration) -> Duration
Validate and clamp expiration time to allowed range
Sourcepub fn expires_in_until(&self, target: DateTime<Utc>) -> Duration
pub fn expires_in_until(&self, target: DateTime<Utc>) -> Duration
Calculate expiration time from a target datetime
Trait Implementations§
Source§impl Clone for StorageUrlConfig
impl Clone for StorageUrlConfig
Source§fn clone(&self) -> StorageUrlConfig
fn clone(&self) -> StorageUrlConfig
Returns a duplicate of the value. Read more
1.0.0 · 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 StorageUrlConfig
impl Debug for StorageUrlConfig
Auto Trait Implementations§
impl Freeze for StorageUrlConfig
impl RefUnwindSafe for StorageUrlConfig
impl Send for StorageUrlConfig
impl Sync for StorageUrlConfig
impl Unpin for StorageUrlConfig
impl UnsafeUnpin for StorageUrlConfig
impl UnwindSafe for StorageUrlConfig
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<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> 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 moreCreates a shared type from an unshared type.