pub struct PresignedUploadTask {Show 13 fields
pub id: PresignedUploadTaskId,
pub status: PresignedTaskStatus,
pub name: String,
pub mime: String,
pub size: i32,
pub document_box: DocumentBoxScopeRaw,
pub folder_id: FolderId,
pub file_key: String,
pub created_at: DateTime<Utc>,
pub expires_at: DateTime<Utc>,
pub created_by: Option<UserId>,
pub parent_id: Option<FileId>,
pub processing_config: Option<Json<Value>>,
}Expand description
Task storing the details for a presigned upload task
Fields§
§id: PresignedUploadTaskIdID of the upload task
status: PresignedTaskStatusFile created from the outcome of this task
name: StringName of the file being uploaded
mime: StringMime type of the file being uploaded
size: i32Expected size in bytes of the file
document_box: DocumentBoxScopeRawID of the document box the folder belongs to
folder_id: FolderIdTarget folder to store the file in
file_key: StringS3 key where the file should be stored
created_at: DateTime<Utc>Creation timestamp of the upload task
expires_at: DateTime<Utc>Timestamp of when the presigned URL will expire (Used as the date for background cleanup, to ensure that all files)
created_by: Option<UserId>User who created the file
parent_id: Option<FileId>Optional file to make the parent of this file
processing_config: Option<Json<Value>>Config that can be used when processing for additional configuration to how the file is processed
Implementations§
Source§impl PresignedUploadTask
impl PresignedUploadTask
Sourcepub async fn create(
db: impl DbExecutor<'_>,
create: CreatePresignedUploadTask,
) -> DbResult<PresignedUploadTask>
pub async fn create( db: impl DbExecutor<'_>, create: CreatePresignedUploadTask, ) -> DbResult<PresignedUploadTask>
Create a new presigned upload task
pub async fn set_status( &mut self, db: impl DbExecutor<'_>, status: PresignedTaskStatus, ) -> DbResult<()>
Sourcepub async fn find(
db: impl DbExecutor<'_>,
scope: &DocumentBoxScopeRaw,
task_id: PresignedUploadTaskId,
) -> DbResult<Option<PresignedUploadTask>>
pub async fn find( db: impl DbExecutor<'_>, scope: &DocumentBoxScopeRaw, task_id: PresignedUploadTaskId, ) -> DbResult<Option<PresignedUploadTask>>
Find a specific presigned upload task
Sourcepub async fn find_expired(
db: impl DbExecutor<'_>,
current_date: DateTime<Utc>,
) -> DbResult<Vec<PresignedUploadTask>>
pub async fn find_expired( db: impl DbExecutor<'_>, current_date: DateTime<Utc>, ) -> DbResult<Vec<PresignedUploadTask>>
Finds all presigned uploads that have expired based on the current date
Sourcepub async fn find_by_file_key(
db: impl DbExecutor<'_>,
file_key: &str,
) -> DbResult<Option<PresignedUploadTask>>
pub async fn find_by_file_key( db: impl DbExecutor<'_>, file_key: &str, ) -> DbResult<Option<PresignedUploadTask>>
Find a specific presigned upload task
Sourcepub async fn delete(
db: impl DbExecutor<'_>,
task_id: PresignedUploadTaskId,
) -> DbResult<()>
pub async fn delete( db: impl DbExecutor<'_>, task_id: PresignedUploadTaskId, ) -> DbResult<()>
Delete a specific presigned upload task
Trait Implementations§
Source§impl Debug for PresignedUploadTask
impl Debug for PresignedUploadTask
Source§impl<'a, R: Row> FromRow<'a, R> for PresignedUploadTaskwhere
&'a str: ColumnIndex<R>,
PresignedUploadTaskId: Decode<'a, R::Database> + Type<R::Database>,
Json<PresignedTaskStatus>: Decode<'a, R::Database> + Type<R::Database>,
String: Decode<'a, R::Database> + Type<R::Database>,
i32: Decode<'a, R::Database> + Type<R::Database>,
DocumentBoxScopeRaw: Decode<'a, R::Database> + Type<R::Database>,
FolderId: Decode<'a, R::Database> + Type<R::Database>,
DateTime<Utc>: Decode<'a, R::Database> + Type<R::Database>,
Option<UserId>: Decode<'a, R::Database> + Type<R::Database>,
Option<FileId>: Decode<'a, R::Database> + Type<R::Database>,
Option<Json<Value>>: Decode<'a, R::Database> + Type<R::Database>,
impl<'a, R: Row> FromRow<'a, R> for PresignedUploadTaskwhere
&'a str: ColumnIndex<R>,
PresignedUploadTaskId: Decode<'a, R::Database> + Type<R::Database>,
Json<PresignedTaskStatus>: Decode<'a, R::Database> + Type<R::Database>,
String: Decode<'a, R::Database> + Type<R::Database>,
i32: Decode<'a, R::Database> + Type<R::Database>,
DocumentBoxScopeRaw: Decode<'a, R::Database> + Type<R::Database>,
FolderId: Decode<'a, R::Database> + Type<R::Database>,
DateTime<Utc>: Decode<'a, R::Database> + Type<R::Database>,
Option<UserId>: Decode<'a, R::Database> + Type<R::Database>,
Option<FileId>: Decode<'a, R::Database> + Type<R::Database>,
Option<Json<Value>>: Decode<'a, R::Database> + Type<R::Database>,
Auto Trait Implementations§
impl Freeze for PresignedUploadTask
impl RefUnwindSafe for PresignedUploadTask
impl Send for PresignedUploadTask
impl Sync for PresignedUploadTask
impl Unpin for PresignedUploadTask
impl UnwindSafe for PresignedUploadTask
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
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>
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>
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 more