mirror of
https://github.com/actix/examples
synced 2024-12-02 18:02:22 +01:00
26 lines
577 B
Rust
26 lines
577 B
Rust
|
use serde::Serialize;
|
||
|
|
||
|
/// Information about an uploaded file.
|
||
|
#[derive(Debug, Clone, Serialize)]
|
||
|
#[serde(rename_all = "camelCase")]
|
||
|
pub struct UploadedFile {
|
||
|
filename: String,
|
||
|
s3_key: String,
|
||
|
s3_url: String,
|
||
|
}
|
||
|
|
||
|
impl UploadedFile {
|
||
|
/// Construct new uploaded file info container.
|
||
|
pub fn new(
|
||
|
filename: impl Into<String>,
|
||
|
s3_key: impl Into<String>,
|
||
|
s3_url: impl Into<String>,
|
||
|
) -> Self {
|
||
|
Self {
|
||
|
filename: filename.into(),
|
||
|
s3_key: s3_key.into(),
|
||
|
s3_url: s3_url.into(),
|
||
|
}
|
||
|
}
|
||
|
}
|