Questions tagged [actix-web]
488 questions
0
votes
0 answers
Actix-Web runtime error: thread 'actix-rt:worker:2' panicked at 'AuthenticationMiddleware was called already'
I have an actix-web server using HttpAuthentication middleware to authenticate all requests. The server runs fine and responds correctly to most requests, but occasionally certain requests trigger the error:
thread 'actix-rt:worker:2' panicked at…

Jared Forth
- 1,577
- 6
- 17
- 32
0
votes
1 answer
How to return a mapped future in an actix_web FromRequest trait implementation?
I have the following implementation of the actix_web FromRequest trait:
impl ::actix_web::FromRequest for Box {
type Error = ::actix_web::Error;
type Future =
…

Rasmus Hansen
- 1,502
- 1
- 17
- 28
0
votes
1 answer
Does actix_web's App::register_data create a single instance or one instance per thread?
I am trying to set up a global state for my actix_web::HttpServer, and it seems like register_data is the proper API (I could be wrong).
From the documentation, it is not clear to me how to create a single instance of application data shared by all…

user1783732
- 1,599
- 5
- 22
- 44
0
votes
2 answers
Does the Rust Actix Web support MongoDB?
I have a new Backend Learning by Rust Programming.
Starting from Web Framework.
Since I would like to use Rust Backend with MongoDB so I have the example code of Nickel.
Anyway, I also see that there is Actix Web Framework.
Does Actix Web support…

sirisakc
- 892
- 2
- 15
- 30
0
votes
1 answer
Error handling and conditional chaining of Actix actors
This is my first attempt at writing a small webservice with rust, using actix-web.
The code below is a request handler that is intended to do three things, insert an entry in the database, send an email if that db call was successful, and then…

States
- 548
- 5
- 15
0
votes
0 answers
How to save an actix multipart field to s3 using rusoto_s3?
Im completely new to rust, but learning. I am attempting to take a multipart upload using actix_web and actix_multipart and upload it to aws s3 using rusoto_s3. From my basic undersntaing basically i have a stream of one type that i need to convert…

Deep
- 2,988
- 4
- 34
- 44
0
votes
0 answers
How to process files from actix-multipart data without saving it to the disk
The suggested way by actix-web to treat files from multipart/form-data is to save them to fs, but I'd like to make some preparations like guessing format, making thumbnail, calc a hash etc.
Is there a way not to rewrite all the chain of functions…

unegare
- 2,197
- 1
- 11
- 25
0
votes
0 answers
Rust - Passing Trait Objects to Threads
I've been struggling with this for a while now and just going in circles, so I'm hoping someone can point out where I'm going wrong.
I'm playing with Actix Web, and setting up my first handlers - which is a simple Healthcheck of the system. So what…

Graham
- 4,095
- 4
- 29
- 37
-1
votes
1 answer
why the validator did not work as expect in rust
I am using actix-web as my web server, now I want to limit the request parameter length, what I am tried to do like this:
use actix_web::{get, App, HttpResponse, HttpServer, Responder, web};
use validator::Validate;
#[derive(serde::Deserialize,…

Dolphin
- 29,069
- 61
- 260
- 539
-1
votes
1 answer
I am trying to use spa in actix_web_lab but it seems there is import error
error[E0432]: unresolved import `actix_web_lab::web::spa`
--> backend/src/main.rs:14:5
|
14 | use actix_web_lab::web::spa;
| ^^^^^^^^^^^^^^^^^^^^^^^ no `spa` in `web`
For more information about this error, try `rustc --explain…

Kent Daniel
- 1
- 1
-1
votes
0 answers
Rust MongoDB API Not Updating Bson Array on Database
So, I am making an API with actix and MongoDB, and I did some testing with the Rust MongoDB API beforehand, in which the basic code goes like this:
// Collections, basically just db names
let users =…

FyreWolf
- 11
- 1
- 3
-1
votes
2 answers
the trait `Clone` is not implemented for `actix_web::Scope`
I want to group my app routes in scope, so I can separate their file location per Domain in the future.
what I'm trying to do is convert
HttpServer::new(move ||…

javad bat
- 4,236
- 6
- 26
- 44
-1
votes
1 answer
actix minimal channel example
I'm trying to replicate a simple benchmark for async-channel in actix-web. However, actix seems never to call the recv function. How can this be?
Does the await in the sending thread never cause tokio to yield to the other thread? I thought await…

Test
- 962
- 9
- 26
-1
votes
1 answer
How to set the temp directory for awmp in actix web with awmp::PartsConfig or how to use awmp::PartsConfig with acrix web?
app_data(web::Data::new(
awmp::PartsConfig.with_temp_dir("/home/o/blah/static/image"); // returns struct not
//value
)

Raphael Hawk
- 11
- 6
-1
votes
1 answer
Diesel migration force String instead of Uuid in schema.rs
I have a problem with the diesel migration. I need to implement Uuid as primary key for a model. I got a lot of issues with the Uuid integration (feature uuidv07, uuid crate,..) but when I specify the type uuid in the migration, diesel generate a…

jenoh
- 165
- 3
- 17