pub struct PresignedRequest {
pub backend: PresignedRequestBackend,
pub expiration: DateTime<Utc>,
pub operation: PresignedOperation,
pub path: String,
}Expand description
A presigned request that can be serialized, stored, and executed later. Hides implementation details for different storage backends.
Fields§
§backend: PresignedRequestBackendThe storage backend this request targets
expiration: DateTime<Utc>When this presigned request expires
operation: PresignedOperationThe operation this request performs
path: StringThe path this request operates on
Implementations§
Source§impl PresignedRequest
impl PresignedRequest
Sourcepub fn new_http(
url: String,
method: String,
headers: HashMap<String, String>,
operation: PresignedOperation,
path: String,
expiration: DateTime<Utc>,
) -> Self
pub fn new_http( url: String, method: String, headers: HashMap<String, String>, operation: PresignedOperation, path: String, expiration: DateTime<Utc>, ) -> Self
Create a new HTTP-based presigned request
Sourcepub fn new_local(
file_path: String,
operation: PresignedOperation,
path: String,
expiration: DateTime<Utc>,
) -> Self
pub fn new_local( file_path: String, operation: PresignedOperation, path: String, expiration: DateTime<Utc>, ) -> Self
Create a new local filesystem presigned request
Sourcepub async fn execute(&self, body: Option<Bytes>) -> Result<PresignedResponse>
pub async fn execute(&self, body: Option<Bytes>) -> Result<PresignedResponse>
Execute this presigned request with optional body data. For PUT operations, body should contain the data to upload. For GET/DELETE operations, body is typically None.
Sourcepub fn url(&self) -> String
pub fn url(&self) -> String
Get a URL representation of this presigned request. For local storage, returns a local:// URL. For cloud storage, returns the actual presigned URL.
Sourcepub fn is_expired(&self) -> bool
pub fn is_expired(&self) -> bool
Check if this presigned request has expired
Trait Implementations§
Source§impl Clone for PresignedRequest
impl Clone for PresignedRequest
Source§fn clone(&self) -> PresignedRequest
fn clone(&self) -> PresignedRequest
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 PresignedRequest
impl Debug for PresignedRequest
Source§impl<'de> Deserialize<'de> for PresignedRequest
impl<'de> Deserialize<'de> for PresignedRequest
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for PresignedRequest
impl PartialEq for PresignedRequest
Source§impl Serialize for PresignedRequest
impl Serialize for PresignedRequest
impl Eq for PresignedRequest
impl StructuralPartialEq for PresignedRequest
Auto Trait Implementations§
impl Freeze for PresignedRequest
impl RefUnwindSafe for PresignedRequest
impl Send for PresignedRequest
impl Sync for PresignedRequest
impl Unpin for PresignedRequest
impl UnsafeUnpin for PresignedRequest
impl UnwindSafe for PresignedRequest
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.