postgresqlrustactix-webtokio-postgres

"error serializing parameter 8: cannot convert between the Rust type `alloc::string::String` and the Postgres type `_text`"


i'm using actix-web framework version 4.4 and when i'm try to insert a row to postgres database with using tokio-postgres package and this package i take this error. My columns on users table on postgres and it's data types as that:


id: text
fullname: text
nickname: text
password: text
email: text
bucket: integer
transactions: jsonb[]
files: text[]
is_verified: integer

And here is my codes:

My controller:


pub async fn registering_controller(user_form: web::Form<models::RegisterInputs>, db_data: web::Data<Pool>, req: HttpRequest) -> impl Responder {
    let user = authlogic::check_auth_status(req);

    if user.is_auth_exist {
        return HttpResponse::SeeOther().append_header(("location", "/")).finish();
    }

    let get_pool = db_data.as_ref();

    let get_all_users = database::get_all_user_rows(&get_pool).await.unwrap();

    for (index, user) in get_all_users.iter().enumerate() {
        if user.nickname == user_form.nickname.clone() {
            return HttpResponse::SeeOther().append_header(("location", "/register?error=nicknameexist")).finish()
        }

        if user.email == user_form.electronicmail.clone() {
            return HttpResponse::SeeOther().append_header(("location", "/register?error=emailexist")).finish()
        }
    }

    let new_user = models::UserModel {
        fullname: user_form.fullname.clone(),
        nickname: user_form.nickname.clone(),
        password: utils::hash30(user_form.password.as_str()),
        email: user_form.electronicmail.clone(),
        role: "User".to_string(),
        bucket: 0 as i32,
        is_verified: 0,
        files: Vec::new(),
        transactions: Vec::new(),
        id: utils::generate_random_id(30),
    };


    database::insert_user_row(&get_pool, &new_user).await.unwrap();

    HttpResponse::SeeOther().append_header(("location", "/")).finish()
}

insert_user_row function:


pub async fn insert_user_row(pool: &Pool, user: &models::UserModel) -> Result<(), models::CustomError> {
    let client: Client = pool.get().await.map_err(|e| models::CustomError::new(&e.to_string()))?;

    let query = "INSERT INTO public.users (id, fullname, nickname, password, email, role, bucket, is_verified, files, transactions) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10)".to_string();

    let transactions_json = serde_json::to_string(&user.transactions).map_err(|e| models::CustomError::new(&e.to_string()))?;
    
    let files_value = serde_json::to_value(&user.files).map_err(|e| models::CustomError::new(&e.to_string()))?;
    
    let files_string = serde_json::to_string(&files_value).map_err(|e| models::CustomError::new(&e.to_string()))?;

    client
        .execute(&query, &[&user.id, &user.fullname, &user.nickname, &user.password, &user.email, &user.role, &user.bucket, &user.is_verified, &files_string, &transactions_json])
        .await
        .map_err(|e| models::CustomError::new(&e.to_string()))?;

    Ok(())
}

dependencies of database crate:


[package]
name = "database"
version = "0.1.0"
edition = "2021"

[dependencies]
deadpool-postgres = { version = "^0.11.0", features = ["serde"] }
tokio = { version = "1.29.1", features = ["full"] }
tokio-postgres = { version = "0.7.10", features = ["with-serde_json-1"] }
tokio-pg-mapper = "0.2.0"
serde_json = "1.0.107" 
models = { path = "../models" }

My related models and implementations:


impl<'a> FromSql<'a> for Purchase {
    fn from_sql(_: &Type, raw: &'a [u8]) -> Result<Self, Box<dyn Error + Sync + Send>> {
        let json_str = std::str::from_utf8(raw)?;
        let purchase: Purchase = serde_json::from_str(json_str)?;
        Ok(purchase)
    }

    fn accepts(ty: &Type) -> bool {
        ty.name() == "json" || ty.name() == "jsonb"
    }
}

#[derive(Debug, serde::Serialize, serde::Deserialize, Clone)]
pub struct Purchase {
    pub amount: i32,
    pub merchant_oid: String,
    pub purchase_id: String,
    pub currency: String
}

impl<'a> From<&'a tokio_postgres::Row> for UserModel {
    fn from(row: &'a tokio_postgres::Row) -> Self {
        UserModel {
            id: row.get("id"),
            fullname: row.get("fullname"),
            nickname: row.get("nickname"),
            password: row.get("password"),
            email: row.get("email"),
            role: row.get("role"),
            bucket: row.get("bucket"),
            is_verified: row.get("is_verified"),
            files: row.get("files"),
            transactions: row.get("transactions")
        }
    }
}

#[derive(Debug, serde::Serialize, serde::Deserialize, Clone)]
pub struct UserModel {
    pub id: String,
    pub fullname: String,
    pub nickname: String,
    pub password: String,
    pub email: String,
    pub role: String,
    pub bucket: i32,
    pub is_verified: i32,
    pub files: Vec<String>,
    pub transactions: Vec<Purchase>
}

#[derive(Debug, serde::Deserialize)]
pub struct RegisterInputs {
    pub fullname: String,
    pub nickname: String,
    pub password: String,
    pub electronicmail: String,
}

end i got these error from my terminal:

thread 'actix-rt|system:0|arbiter:6' panicked at 'called `Result::unwrap()` on an `Err` value: CustomError { message: "error serializing parameter 8: cannot convert between the Rust type `alloc::string::String` and the Postgres type `_text`" }', C:\Users\...\Desktop\...\...\postctrl\src\lib.rs:46:59
stack backtrace:
   0:     0x7ff79236145c - std::sys_common::backtrace::_print::impl$0::fmt
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library\std\src\sys_common\backtrace.rs:44
   1:     0x7ff79237e08b - core::fmt::rt::Argument::fmt
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library\core\src\fmt\rt.rs:138
   2:     0x7ff79237e08b - core::fmt::write
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library\core\src\fmt\mod.rs:1094
   3:     0x7ff79235c9d9 - std::io::Write::write_fmt<std::sys::windows::stdio::Stderr>
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library\std\src\io\mod.rs:1713
   4:     0x7ff79236120b - std::sys_common::backtrace::_print
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library\std\src\sys_common\backtrace.rs:47
   5:     0x7ff79236120b - std::sys_common::backtrace::print
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library\std\src\sys_common\backtrace.rs:34
   6:     0x7ff792363a19 - std::panicking::default_hook::closure$1
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library\std\src\panicking.rs:269
   7:     0x7ff7923636cf - std::panicking::default_hook
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library\std\src\panicking.rs:288
   8:     0x7ff792363f1e - std::panicking::rust_panic_with_hook
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library\std\src\panicking.rs:705
   9:     0x7ff792363e0d - std::panicking::begin_panic_handler::closure$0
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library\std\src\panicking.rs:597
  10:     0x7ff792361dd9 - std::sys_common::backtrace::__rust_end_short_backtrace<std::panicking::begin_panic_handler::closure_env$0,never$>
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library\std\src\sys_common\backtrace.rs:151
  11:     0x7ff792363b10 - std::panicking::begin_panic_handler
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library\std\src\panicking.rs:593
  12:     0x7ff7924464a5 - core::panicking::panic_fmt
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library\core\src\panicking.rs:67
  13:     0x7ff792446ab3 - core::result::unwrap_failed
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library\core\src\result.rs:1651
  14:     0x7ff791a2ca4a - enum2$<core::result::Result<tuple$<>,models::CustomError> >::unwrap<tuple$<>,models::CustomError>
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225\library\core\src\result.rs:1076
  15:     0x7ff791a54181 - postctrl::registering_controller::async_fn$0
                               at C:\Users\necdet\Desktop\work-files-formatter-website\wFormatter\postctrl\src\lib.rs:46
  16:     0x7ff791a42fbf - actix_web::handler::handler_service::closure$0::async_block$0<enum2$<postctrl::registering_controller::async_fn_env$0> (*)(actix_web::types::form::Form<models::RegisterInputs>,actix_web::data::Data<deadpool::managed::Pool<deadpool_postgres::Manager,deadpo
                               at C:\Users\necdet\.cargo\registry\src\index.crates.io-6f17d22bba15001f\actix-web-4.4.0\src\handler.rs:106
  17:     0x7ff791c3d257 - core::future::future::impl$1::poll<alloc::boxed::Box<dyn$<core::future::future::Future<assoc$<Output,enum2$<core::result::Result<actix_web::service::ServiceResponse<actix_http::body::boxed::BoxBody>,actix_web::error::error::Error> > > > >,alloc::alloc::Gl
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225\library\core\src\future\future.rs:125
  18:     0x7ff791c3fbe6 - actix_web::resource::impl$3::register::closure$0::async_block$0<actix_web::resource::ResourceEndpoint,actix_http::body::boxed::BoxBody>
                               at C:\Users\necdet\.cargo\registry\src\index.crates.io-6f17d22bba15001f\actix-web-4.4.0\src\resource.rs:452
  19:     0x7ff791c3d257 - core::future::future::impl$1::poll<alloc::boxed::Box<dyn$<core::future::future::Future<assoc$<Output,enum2$<core::result::Result<actix_web::service::ServiceResponse<actix_http::body::boxed::BoxBody>,actix_web::error::error::Error> > > > >,alloc::alloc::Gl
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225\library\core\src\future\future.rs:125
  20:     0x7ff791924496 - actix_web::scope::impl$2::register::closure$3::async_block$0<actix_web::scope::ScopeEndpoint,actix_http::body::boxed::BoxBody>
                               at C:\Users\necdet\.cargo\registry\src\index.crates.io-6f17d22bba15001f\actix-web-4.4.0\src\scope.rs:430
  21:     0x7ff791c3d257 - core::future::future::impl$1::poll<alloc::boxed::Box<dyn$<core::future::future::Future<assoc$<Output,enum2$<core::result::Result<actix_web::service::ServiceResponse<actix_http::body::boxed::BoxBody>,actix_web::error::error::Error> > > > >,alloc::alloc::Gl
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225\library\core\src\future\future.rs:125
  22:     0x7ff791c3d257 - core::future::future::impl$1::poll<alloc::boxed::Box<dyn$<core::future::future::Future<assoc$<Output,enum2$<core::result::Result<actix_web::service::ServiceResponse<actix_http::body::boxed::BoxBody>,actix_web::error::error::Error> > > > >,alloc::alloc::Gl
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225\library\core\src\future\future.rs:125
  23:     0x7ff79199d66c - authlogic::refresh_cookies::async_fn$0<actix_http::body::boxed::BoxBody>
                               at C:\Users\necdet\Desktop\work-files-formatter-website\wFormatter\authlogic\src\lib.rs:89
  24:     0x7ff79191377c - actix_service::map_err::impl$4::poll<actix_web::app_service::AppInitService<actix_web_lab::middleware_from_fn::MiddlewareFnService<enum2$<authlogic::refresh_cookies::async_fn_env$0<actix_http::body::boxed::BoxBody> > (*)(actix_web::service::ServiceRequest
                               at C:\Users\necdet\.cargo\registry\src\index.crates.io-6f17d22bba15001f\actix-service-2.0.2\src\map_err.rs:99
  25:     0x7ff791904302 - actix_http::h1::dispatcher::InnerDispatcher<tokio::net::tcp::stream::TcpStream,actix_service::map_err::MapErr<actix_web::app_service::AppInitService<actix_web_lab::middleware_from_fn::MiddlewareFnService<enum2$<authlogic::refresh_cookies::async_fn_env$0<a
                               at C:\Users\necdet\.cargo\registry\src\index.crates.io-6f17d22bba15001f\actix-http-3.4.0\src\h1\dispatcher.rs:466
  26:     0x7ff79190bd13 - actix_http::h1::dispatcher::impl$4::poll<tokio::net::tcp::stream::TcpStream,actix_service::map_err::MapErr<actix_web::app_service::AppInitService<actix_web_lab::middleware_from_fn::MiddlewareFnService<enum2$<authlogic::refresh_cookies::async_fn_env$0<acti
                               at C:\Users\necdet\.cargo\registry\src\index.crates.io-6f17d22bba15001f\actix-http-3.4.0\src\h1\dispatcher.rs:1125
  27:     0x7ff79192b3f3 - actix_http::service::impl$8::poll<tokio::net::tcp::stream::TcpStream,actix_service::map_err::MapErr<actix_web::app_service::AppInitService<actix_web_lab::middleware_from_fn::MiddlewareFnService<enum2$<authlogic::refresh_cookies::async_fn_env$0<actix_http:
                               at C:\Users\necdet\.cargo\registry\src\index.crates.io-6f17d22bba15001f\actix-http-3.4.0\src\service.rs:860
  28:     0x7ff7919d7b07 - actix_service::and_then::impl$3::poll<actix_service::fn_service::FnService<actix_http::service::impl$3::tcp::closure_env$0<actix_service::map_config::MapConfig<actix_service::map_err::MapErrServiceFactory<actix_web::app_service::AppInit<actix_service::tra
                               at C:\Users\necdet\.cargo\registry\src\index.crates.io-6f17d22bba15001f\actix-service-2.0.2\src\and_then.rs:114
  29:     0x7ff7919daa3b - actix_server::service::impl$1::call::async_block$0<actix_service::and_then::AndThenService<actix_service::fn_service::FnService<actix_http::service::impl$3::tcp::closure_env$0<actix_service::map_config::MapConfig<actix_service::map_err::MapErrServiceFacto
                               at C:\Users\necdet\.cargo\registry\src\index.crates.io-6f17d22bba15001f\actix-server-2.3.0\src\service.rs:75
  30:     0x7ff79197f9cc - tokio::runtime::task::core::impl$6::poll::closure$0<enum2$<actix_server::service::impl$1::call::async_block_env$0<actix_service::and_then::AndThenService<actix_service::fn_service::FnService<actix_http::service::impl$3::tcp::closure_env$0<actix_service::m
                               at C:\Users\necdet\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.32.0\src\runtime\task\core.rs:334
  31:     0x7ff79197f798 - tokio::loom::std::unsafe_cell::UnsafeCell<enum2$<tokio::runtime::task::core::Stage<enum2$<actix_server::service::impl$1::call::async_block_env$0<actix_service::and_then::AndThenService<actix_service::fn_service::FnService<actix_http::service::impl$3::tcp:
                               at C:\Users\necdet\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.32.0\src\loom\std\unsafe_cell.rs:16
  32:     0x7ff79197f798 - tokio::runtime::task::core::Core<enum2$<actix_server::service::impl$1::call::async_block_env$0<actix_service::and_then::AndThenService<actix_service::fn_service::FnService<actix_http::service::impl$3::tcp::closure_env$0<actix_service::map_config::MapConfi
                               at C:\Users\necdet\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.32.0\src\runtime\task\core.rs:323
  33:     0x7ff7919c92ff - tokio::runtime::task::harness::poll_future::closure$0<enum2$<actix_server::service::impl$1::call::async_block_env$0<actix_service::and_then::AndThenService<actix_service::fn_service::FnService<actix_http::service::impl$3::tcp::closure_env$0<actix_service:
                               at C:\Users\necdet\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.32.0\src\runtime\task\harness.rs:485
  34:     0x7ff7919bda83 - core::panic::unwind_safe::impl$23::call_once<enum2$<core::task::poll::Poll<tuple$<> > >,tokio::runtime::task::harness::poll_future::closure_env$0<enum2$<actix_server::service::impl$1::call::async_block_env$0<actix_service::and_then::AndThenService<actix_s
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225\library\core\src\panic\unwind_safe.rs:271
  35:     0x7ff7919e972b - std::panicking::try::do_call<core::panic::unwind_safe::AssertUnwindSafe<tokio::runtime::task::harness::poll_future::closure_env$0<enum2$<actix_server::service::impl$1::call::async_block_env$0<actix_service::and_then::AndThenService<actix_service::fn_servi
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225\library\std\src\panicking.rs:500
  36:     0x7ff7919ea533 - std::panicking::try::do_catch<core::panic::unwind_safe::AssertUnwindSafe<tokio::runtime::task::harness::impl$2::complete::closure_env$0<enum2$<deadpool_postgres::impl$18::connect::async_block$0::async_block_env$0<tokio_postgres::tls::NoTls> >,alloc::sync:
  37:     0x7ff7919e887b - std::panicking::try<enum2$<core::task::poll::Poll<tuple$<> > >,core::panic::unwind_safe::AssertUnwindSafe<tokio::runtime::task::harness::poll_future::closure_env$0<enum2$<actix_server::service::impl$1::call::async_block_env$0<actix_service::and_then::AndT
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225\library\std\src\panicking.rs:464
  38:     0x7ff7918e182b - std::panic::catch_unwind<core::panic::unwind_safe::AssertUnwindSafe<tokio::runtime::task::harness::poll_future::closure_env$0<enum2$<actix_server::service::impl$1::call::async_block_env$0<actix_service::and_then::AndThenService<actix_service::fn_service::
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225\library\std\src\panic.rs:142
  39:     0x7ff7919c8ac6 - tokio::runtime::task::harness::poll_future<enum2$<actix_server::service::impl$1::call::async_block_env$0<actix_service::and_then::AndThenService<actix_service::fn_service::FnService<actix_http::service::impl$3::tcp::closure_env$0<actix_service::map_config
                               at C:\Users\necdet\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.32.0\src\runtime\task\harness.rs:473
  40:     0x7ff7919c9696 - tokio::runtime::task::harness::Harness<enum2$<actix_server::service::impl$1::call::async_block_env$0<actix_service::and_then::AndThenService<actix_service::fn_service::FnService<actix_http::service::impl$3::tcp::closure_env$0<actix_service::map_config::Ma
                               at C:\Users\necdet\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.32.0\src\runtime\task\harness.rs:208
  41:     0x7ff7919ca493 - tokio::runtime::task::harness::Harness<enum2$<actix_server::service::impl$1::call::async_block_env$0<actix_service::and_then::AndThenService<actix_service::fn_service::FnService<actix_http::service::impl$3::tcp::closure_env$0<actix_service::map_config::Ma
                               at C:\Users\necdet\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.32.0\src\runtime\task\harness.rs:153
  42:     0x7ff7919e250b - tokio::runtime::task::raw::poll<enum2$<actix_server::service::impl$1::call::async_block_env$0<actix_service::and_then::AndThenService<actix_service::fn_service::FnService<actix_http::service::impl$3::tcp::closure_env$0<actix_service::map_config::MapConfig
                               at C:\Users\necdet\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.32.0\src\runtime\task\raw.rs:276
  43:     0x7ff79226e0c6 - tokio::runtime::task::raw::RawTask::poll
                               at C:\Users\necdet\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.32.0\src\runtime\task\raw.rs:200
  44:     0x7ff7922a37e2 - tokio::runtime::task::LocalNotified<alloc::sync::Arc<tokio::task::local::Shared> >::run<alloc::sync::Arc<tokio::task::local::Shared> >
                               at C:\Users\necdet\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.32.0\src\runtime\task\mod.rs:400
  45:     0x7ff792278cfe - tokio::task::local::impl$2::tick::closure$0
                               at C:\Users\necdet\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.32.0\src\task\local.rs:617
  46:     0x7ff792278c33 - tokio::runtime::coop::with_budget
                               at C:\Users\necdet\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.32.0\src\runtime\coop.rs:107
  47:     0x7ff792278c33 - tokio::runtime::coop::budget
                               at C:\Users\necdet\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.32.0\src\runtime\coop.rs:73
  48:     0x7ff792278c33 - tokio::task::local::LocalSet::tick
                               at C:\Users\necdet\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.32.0\src\task\local.rs:617
  49:     0x7ff792245640 - tokio::task::local::impl$8::poll::closure$0<actix_rt::arbiter::ArbiterRunner>
                               at C:\Users\necdet\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.32.0\src\task\local.rs:953
  50:     0x7ff792243c09 - tokio::task::local::impl$2::with::closure$0<enum2$<core::task::poll::Poll<tuple$<> > >,tokio::task::local::impl$8::poll::closure_env$0<actix_rt::arbiter::ArbiterRunner> >
                               at C:\Users\necdet\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.32.0\src\task\local.rs:686
  51:     0x7ff792260e12 - std::thread::local::LocalKey<tokio::task::local::LocalData>::try_with<tokio::task::local::LocalData,tokio::task::local::impl$2::with::closure_env$0<enum2$<core::task::poll::Poll<tuple$<> > >,tokio::task::local::impl$8::poll::closure_env$0<actix_rt::arbite
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225\library\std\src\thread\local.rs:270
  52:     0x7ff79225f8ae - std::thread::local::LocalKey<tokio::task::local::LocalData>::with<tokio::task::local::LocalData,tokio::task::local::impl$2::with::closure_env$0<enum2$<core::task::poll::Poll<tuple$<> > >,tokio::task::local::impl$8::poll::closure_env$0<actix_rt::arbiter::A
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225\library\std\src\thread\local.rs:246
  53:     0x7ff792243b19 - tokio::task::local::LocalSet::with<enum2$<core::task::poll::Poll<tuple$<> > >,tokio::task::local::impl$8::poll::closure_env$0<actix_rt::arbiter::ArbiterRunner> >
                               at C:\Users\necdet\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.32.0\src\task\local.rs:669
  54:     0x7ff7922453a8 - tokio::task::local::impl$8::poll<actix_rt::arbiter::ArbiterRunner>
                               at C:\Users\necdet\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.32.0\src\task\local.rs:939
  55:     0x7ff792244151 - tokio::task::local::impl$2::run_until::async_fn$0<actix_rt::arbiter::ArbiterRunner>
                               at C:\Users\necdet\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.32.0\src\task\local.rs:575
  56:     0x7ff79224945b - core::future::future::impl$1::poll<ref_mut$<enum2$<tokio::task::local::impl$2::run_until::async_fn_env$0<actix_rt::arbiter::ArbiterRunner> > > > 
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225\library\core\src\future\future.rs:125
  57:     0x7ff7922670a0 - tokio::runtime::scheduler::current_thread::impl$8::block_on::closure$0::closure$0::closure$0<core::pin::Pin<ref_mut$<enum2$<tokio::task::local::impl$2::run_until::async_fn_env$0<actix_rt::arbiter::ArbiterRunner> > > > >
                               at C:\Users\necdet\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.32.0\src\runtime\scheduler\current_thread\mod.rs:665
  58:     0x7ff792266f5b - tokio::runtime::coop::with_budget
                               at C:\Users\necdet\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.32.0\src\runtime\coop.rs:107
  59:     0x7ff792266f5b - tokio::runtime::coop::budget
                               at C:\Users\necdet\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.32.0\src\runtime\coop.rs:73
  60:     0x7ff792266f5b - tokio::runtime::scheduler::current_thread::impl$8::block_on::closure$0::closure$0<core::pin::Pin<ref_mut$<enum2$<tokio::task::local::impl$2::run_until::async_fn_env$0<actix_rt::arbiter::ArbiterRunner> > > > >
                               at C:\Users\necdet\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.32.0\src\runtime\scheduler\current_thread\mod.rs:665
  61:     0x7ff79226431b - tokio::runtime::scheduler::current_thread::Context::enter<enum2$<core::task::poll::Poll<tuple$<> > >,tokio::runtime::scheduler::current_thread::impl$8::block_on::closure$0::closure_env$0<core::pin::Pin<ref_mut$<enum2$<tokio::task::local::impl$2::run_until
                               at C:\Users\necdet\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.32.0\src\runtime\scheduler\current_thread\mod.rs:410
  62:     0x7ff792265c4d - tokio::runtime::scheduler::current_thread::impl$8::block_on::closure$0<core::pin::Pin<ref_mut$<enum2$<tokio::task::local::impl$2::run_until::async_fn_env$0<actix_rt::arbiter::ArbiterRunner> > > > >
                               at C:\Users\necdet\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.32.0\src\runtime\scheduler\current_thread\mod.rs:664
  63:     0x7ff792265900 - tokio::runtime::scheduler::current_thread::impl$8::enter::closure$0<tokio::runtime::scheduler::current_thread::impl$8::block_on::closure_env$0<core::pin::Pin<ref_mut$<enum2$<tokio::task::local::impl$2::run_until::async_fn_env$0<actix_rt::arbiter::ArbiterR
                               at C:\Users\necdet\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.32.0\src\runtime\scheduler\current_thread\mod.rs:743
  64:     0x7ff7922403e6 - tokio::runtime::context::scoped::Scoped<enum2$<tokio::runtime::scheduler::Context> >::set<enum2$<tokio::runtime::scheduler::Context>,tokio::runtime::scheduler::current_thread::impl$8::enter::closure_env$0<tokio::runtime::scheduler::current_thread::impl$8:
                               at C:\Users\necdet\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.32.0\src\runtime\context\scoped.rs:40
  65:     0x7ff792244c95 - tokio::runtime::context::set_scheduler::closure$0<tuple$<alloc::boxed::Box<tokio::runtime::scheduler::current_thread::Core,alloc::alloc::Global>,enum2$<core::option::Option<tuple$<> > > >,tokio::runtime::scheduler::current_thread::impl$8::enter::closure_e
                               at C:\Users\necdet\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.32.0\src\runtime\context.rs:176
  66:     0x7ff7922602e2 - std::thread::local::LocalKey<tokio::runtime::context::Context>::try_with<tokio::runtime::context::Context,tokio::runtime::context::set_scheduler::closure_env$0<tuple$<alloc::boxed::Box<tokio::runtime::scheduler::current_thread::Core,alloc::alloc::Global>,
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225\library\std\src\thread\local.rs:270
  67:     0x7ff79225fa7e - std::thread::local::LocalKey<tokio::runtime::context::Context>::with<tokio::runtime::context::Context,tokio::runtime::context::set_scheduler::closure_env$0<tuple$<alloc::boxed::Box<tokio::runtime::scheduler::current_thread::Core,alloc::alloc::Global>,enum
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225\library\std\src\thread\local.rs:246
  68:     0x7ff792244c40 - tokio::runtime::context::set_scheduler<tuple$<alloc::boxed::Box<tokio::runtime::scheduler::current_thread::Core,alloc::alloc::Global>,enum2$<core::option::Option<tuple$<> > > >,tokio::runtime::scheduler::current_thread::impl$8::enter::closure_env$0<tokio:
                               at C:\Users\necdet\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.32.0\src\runtime\context.rs:176
  69:     0x7ff792265354 - tokio::runtime::scheduler::current_thread::CoreGuard::enter<tokio::runtime::scheduler::current_thread::impl$8::block_on::closure_env$0<core::pin::Pin<ref_mut$<enum2$<tokio::task::local::impl$2::run_until::async_fn_env$0<actix_rt::arbiter::ArbiterRunner> >
                               at C:\Users\necdet\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.32.0\src\runtime\scheduler\current_thread\mod.rs:743
  70:     0x7ff792265a13 - tokio::runtime::scheduler::current_thread::CoreGuard::block_on<core::pin::Pin<ref_mut$<enum2$<tokio::task::local::impl$2::run_until::async_fn_env$0<actix_rt::arbiter::ArbiterRunner> > > > >
                               at C:\Users\necdet\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.32.0\src\runtime\scheduler\current_thread\mod.rs:652
  71:     0x7ff792263dcd - tokio::runtime::scheduler::current_thread::impl$0::block_on::closure$0<enum2$<tokio::task::local::impl$2::run_until::async_fn_env$0<actix_rt::arbiter::ArbiterRunner> > >
                               at C:\Users\necdet\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.32.0\src\runtime\scheduler\current_thread\mod.rs:175
  72:     0x7ff7922555e6 - tokio::runtime::context::runtime::enter_runtime<tokio::runtime::scheduler::current_thread::impl$0::block_on::closure_env$0<enum2$<tokio::task::local::impl$2::run_until::async_fn_env$0<actix_rt::arbiter::ArbiterRunner> > >,tuple$<> >

Solution

  • files is a Vec<String>. You try to pass a String though.

    _text is the PostgreSQL internal name for a text array.

    That error message tells you that String can't be converted into a "text array".