Questions tagged [rust-actix]

Actix is a rust library built on the Actor Model which allows applications to be written as a group of independently executing but cooperating "Actors" which communicate via messages.

Actix (source code) is a Rust actors framework.

233 questions
0
votes
3 answers

associated type `Context` not found when implementing actix-web's Handler

I have the following code based on the actix-web Database Integration sample. extern crate actix; extern crate actix_web; extern crate serde_json; #[macro_use] extern crate serde_derive; extern crate r2d2; extern crate r2d2_mysql; use…
Satish
  • 3,020
  • 7
  • 35
  • 47
0
votes
1 answer

"Error E0477: the type does not fulfill the required lifetime" with Actix-Web handlers

I am trying to implement an HTTP request handler using Actix-Web. Here is the relevant part of my code: impl Handler for FooBarHandler { type Result = Box>; fn handle(&mut self, req :…
Alex
  • 699
  • 1
  • 10
  • 20
-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…
-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

is there any way to reuse the same struct or do i need to build a new one in Rust?

I got this table in postgres create table tasks_users( id serial primary key, user_id smallint, task_id integer, created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP, deleted_at TIMESTAMP WITH TIME ZONE ) With this table_name |…
Dilakv
  • 83
  • 9
-1
votes
1 answer

could not find `options` in `mongodb` Rust Lang

I am trying to connect to mongodb using in rust using mongodb library here is the code use actix_web::{App, HttpServer}; use mongodb::{Client, options::ClientOptions}; #[actix_rt::main] async fn main() -> std::io::Result<()> { // Parse a connection…
Niraj Gawande
  • 137
  • 1
  • 11
-1
votes
1 answer

Why does my actix Supervisor not retry stopped actors?

I have implemented an actix actor including the Supervised trait. I then tried to start the actor in a supervised way using let _: Addr = Supervisor::start(|_| MyActor::default()); Unfortunately when that actor stops it is not…
TBieniek
  • 4,858
  • 2
  • 24
  • 29
1 2 3
15
16