Trait rhombus::UploadProvider
source · pub trait UploadProvider {
// Required methods
fn routes(&self) -> Result<Router>;
async fn upload<S, E>(&self, filename: &str, stream: S) -> Result<String>
where S: Stream<Item = Result<Bytes, E>> + Send,
E: Into<BoxError>;
}Required Methods§
sourcefn routes(&self) -> Result<Router>
fn routes(&self) -> Result<Router>
The router must implement a POST to /upload/:path route which will upload a file. In most cases,
this can be achieved by using the route_upload_file function.
let provider_state = Arc::new(self.clone());
let router = Router::new()
.route("/upload/:path", post(route_upload_file::<Self>))
.with_state(provider_state);
Ok(router)Object Safety§
This trait is not object safe.
Implementations on Foreign Types§
source§impl UploadProvider for ()
Available on non-crate feature internal only.
impl UploadProvider for ()
Available on non-crate feature
internal only.