pub enum UploadPathScheme<'a> {
ExerciseService {
exercise_service_slug: &'a str,
},
Answer(&'a AnswerUploadDestination),
}Expand description
Where an upload’s objects are stored, and what the upload route hands back for them.
Variants§
ExerciseService
<exercise service slug>/<random> and a permanent url naming that path, for files that
belong to course content rather than to one student: a teacher’s spec files, and the
playground’s throwaway uploads. The slug carries no authorization meaning.
Answer(&'a AnswerUploadDestination)
answers/v1/<course|exam>/<owner>/exercise/<exercise>/user/<user>/<file upload>, so a
retention or takedown rule can find every object of one course, exercise or student without
reading the database, and every object leads back to its row.
The path names the student, so the url handed back carries a claim instead of the path.
Implementations§
Source§impl UploadPathScheme<'_>
impl UploadPathScheme<'_>
Sourcefn path(&self, file_upload_id: Uuid) -> String
fn path(&self, file_upload_id: Uuid) -> String
Where one file of this upload is stored. Applies to new uploads only: old rows keep the layout they were written under, since nothing derives a path from a row.
Sourcefn download_url(
&self,
file_upload_id: Uuid,
path: &str,
file_store: &dyn FileStore,
app_conf: &ApplicationConfiguration,
) -> Result<String, ControllerError>
fn download_url( &self, file_upload_id: Uuid, path: &str, file_store: &dyn FileStore, app_conf: &ApplicationConfiguration, ) -> Result<String, ControllerError>
The url the upload route hands back for one stored file.
Auto Trait Implementations§
impl<'a> Freeze for UploadPathScheme<'a>
impl<'a> RefUnwindSafe for UploadPathScheme<'a>
impl<'a> Send for UploadPathScheme<'a>
impl<'a> Sync for UploadPathScheme<'a>
impl<'a> Unpin for UploadPathScheme<'a>
impl<'a> UnsafeUnpin for UploadPathScheme<'a>
impl<'a> UnwindSafe for UploadPathScheme<'a>
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
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].