├── .gitignore ├── src ├── handlers │ ├── mod.rs │ ├── inserir_transacao.rs │ └── extrato.rs ├── main.rs ├── atomic_fd.rs └── socket_client.rs ├── .dockerignore ├── tests ├── extrato └── mov_saldo ├── Makefile ├── README.md ├── participacao ├── README.md ├── nginx.conf └── docker-compose.yml ├── Dockerfile ├── postgres.conf ├── nginx.conf ├── Cargo.toml ├── docker-compose.yml ├── init.sql └── Cargo.lock /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | .vscode 3 | -------------------------------------------------------------------------------- /src/handlers/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod inserir_transacao; 2 | pub mod extrato; -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | target 2 | Dockerfile 3 | .dockerignore 4 | .git 5 | .gitignore -------------------------------------------------------------------------------- /tests/extrato: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | curl http://localhost:9999/clientes/1/extrato -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | target: 2 | cargo build --release 3 | 4 | image: 5 | docker build . -t distanteagle16/rinhabackend-2 6 | 7 | push-image: 8 | docker push distanteagle16/rinhabackend-2 -------------------------------------------------------------------------------- /tests/mov_saldo: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | curl http://localhost:9999/clientes/1/transacoes \ 4 | -H "Content-Type: application/json" \ 5 | -d '{ "valor": 100, "tipo": "d", "descricao": "abc" }' -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Rinha de Backend (2ª edição) na linguagem mais _blazingly fast™_ do mercado. 🦀🔥 2 | 3 | Stack: 4 | 5 | - Rust (linguagem de programação de alto nível com baixo footprint de memória e performance comparável com a de C/C++) 6 | - Axum (framework HTTP para Rust) 7 | - Tokio (Runtime async com I/O não-bloqueante) 8 | - AlexDB (banco não-relacional projetado para alto volume transacional) 9 | - Serde (lib de desserialização/serialização em JSON) 10 | - Nginx (balanceador de carga baseado em eventos) 11 | -------------------------------------------------------------------------------- /participacao/README.md: -------------------------------------------------------------------------------- 1 | ## Rinha de Backend (2ª edição) na linguagem mais _blazingly fast™_ do mercado. 🦀🔥 2 | 3 | Stack: 4 | 5 | - Rust (linguagem de programação de alto nível com baixo footprint de memória e performance comparável com a de C/C++) 6 | - Axum (framework HTTP para Rust) 7 | - Tokio (Runtime async com I/O não-bloqueante) 8 | - AlexDB (banco não-relacional projetado para alto volume transacional) 9 | - Serde (lib de desserialização/serialização em JSON) 10 | - Nginx (balanceador de carga baseado em eventos) -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM rust:1.76.0 as base 2 | 3 | RUN apt-get update -yqq && apt-get install -yqq cmake g++ 4 | RUN mkdir /tmp/sockets 5 | WORKDIR /app 6 | 7 | FROM base as build 8 | 9 | RUN mkdir src; touch src/main.rs 10 | 11 | COPY Cargo.toml Cargo.lock ./ 12 | 13 | RUN cargo fetch 14 | 15 | COPY src ./src/ 16 | 17 | RUN cargo build --release 18 | 19 | FROM base 20 | 21 | COPY --from=build /app /app 22 | 23 | EXPOSE 80 24 | 25 | RUN chown -R www-data:www-data /tmp/sockets 26 | 27 | USER www-data:www-data 28 | 29 | CMD ./target/release/rinha-backend-rust-2 30 | -------------------------------------------------------------------------------- /postgres.conf: -------------------------------------------------------------------------------- 1 | listen_addresses = '*' 2 | max_connections = 350 3 | superuser_reserved_connections = 3 4 | unix_socket_directories = '/var/run/postgresql' 5 | shared_buffers = 512MB 6 | work_mem = 1MB 7 | maintenance_work_mem = 256MB 8 | # effective_cache_size = 1GB 9 | wal_buffers = 64MB 10 | checkpoint_timeout = 10min 11 | checkpoint_completion_target = 0.9 12 | random_page_cost = 1.1 13 | effective_io_concurrency = 350 14 | autovacuum = on 15 | log_statement = 'none' 16 | log_duration = off 17 | log_lock_waits = on 18 | log_error_verbosity = terse 19 | log_min_messages = panic 20 | log_min_error_statement = panic 21 | synchronous_commit = off 22 | -------------------------------------------------------------------------------- /nginx.conf: -------------------------------------------------------------------------------- 1 | user www-data; 2 | worker_processes auto; 3 | worker_rlimit_nofile 500000; 4 | 5 | events { 6 | use epoll; 7 | worker_connections 1024; 8 | } 9 | http { 10 | access_log off; 11 | error_log /dev/null emerg; 12 | 13 | upstream api { 14 | server unix:/tmp/sockets/api01.sock; 15 | server unix:/tmp/sockets/api02.sock; 16 | keepalive 360; 17 | } 18 | server { 19 | listen 9999; 20 | location / { 21 | proxy_buffering off; 22 | proxy_set_header Connection ""; 23 | proxy_http_version 1.1; 24 | proxy_set_header Keep-Alive ""; 25 | proxy_set_header Proxy-Connection "keep-alive"; 26 | proxy_pass http://api; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /participacao/nginx.conf: -------------------------------------------------------------------------------- 1 | user www-data; 2 | worker_processes auto; 3 | worker_rlimit_nofile 500000; 4 | 5 | events { 6 | use epoll; 7 | worker_connections 1024; 8 | } 9 | http { 10 | access_log off; 11 | error_log /dev/null emerg; 12 | 13 | upstream api { 14 | server unix:/tmp/sockets/api01.sock; 15 | server unix:/tmp/sockets/api02.sock; 16 | keepalive 200; 17 | } 18 | server { 19 | listen 9999; 20 | location / { 21 | proxy_buffering off; 22 | proxy_set_header Connection ""; 23 | proxy_http_version 1.1; 24 | proxy_set_header Keep-Alive ""; 25 | proxy_set_header Proxy-Connection "keep-alive"; 26 | proxy_pass http://api; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "rinha-backend-rust-2" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [profile.release] 7 | codegen-units = 1 8 | lto = true 9 | 10 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 11 | 12 | [dependencies] 13 | anyhow = "1.0.79" 14 | # axum = { version = "0.7.4", features = ["macros"]} 15 | axum = { git = "https://github.com/tokio-rs/axum.git", branch = "david/generic-serve", features = ["macros"] } 16 | chrono = "0.4.33" 17 | futures = "0.3.30" 18 | http-body-util = "0.1.0" 19 | hyper = { version = "1.1.0", features = ["client"] } 20 | hyper-util = { version = "0.1.3", features = ["client-legacy"] } 21 | hyperlocal = { git = "https://github.com/softprops/hyperlocal.git", rev = "34dc8579d74f96b68ddbd55582c76019ae18cfdc" } 22 | reqwest = "0.11.24" 23 | scc = "2.0.16" 24 | serde = { version = "1.0.195", features = ["derive"] } 25 | serde_json = "1.0.113" 26 | tokio = { version = "1.35.1", features = ["full"] } 27 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "3.5" 2 | 3 | services: 4 | api01: &api 5 | build: . 6 | hostname: api01 7 | expose: 8 | - "80" 9 | depends_on: 10 | - db 11 | volumes: 12 | - sockets:/tmp/sockets 13 | - alexdb-storage:/tmp 14 | network_mode: host 15 | deploy: 16 | resources: 17 | limits: 18 | cpus: "0.25" 19 | memory: "50MB" 20 | 21 | api02: 22 | <<: *api 23 | hostname: api02 24 | environment: 25 | PRIMARY: 1 26 | 27 | db: 28 | build: ../alexdb 29 | user: www-data:www-data 30 | environment: 31 | SOCKET_PATH: /tmp/sockets/alexdb.sock 32 | DATA_PATH: /tmp 33 | RESET_FILES: 1 34 | deploy: 35 | resources: 36 | limits: 37 | cpus: "1" 38 | memory: "50MB" 39 | volumes: 40 | - sockets:/tmp/sockets 41 | - alexdb-storage:/tmp 42 | 43 | nginx: 44 | image: nginx:latest 45 | volumes: 46 | - ./nginx.conf:/etc/nginx/nginx.conf:ro 47 | - sockets:/tmp/sockets 48 | depends_on: 49 | - api01 50 | - api02 51 | ports: 52 | - "9999:9999" 53 | network_mode: host 54 | deploy: 55 | resources: 56 | limits: 57 | cpus: "0.2" 58 | memory: "50MB" 59 | 60 | volumes: 61 | sockets: 62 | alexdb-storage: 63 | -------------------------------------------------------------------------------- /participacao/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "3.5" 2 | 3 | services: 4 | api01: &api 5 | image: distanteagle16/rinhabackend-2:latest 6 | hostname: api01 7 | expose: 8 | - "80" 9 | depends_on: 10 | - db 11 | volumes: 12 | - sockets:/tmp/sockets 13 | - alexdb-storage:/tmp 14 | network_mode: host 15 | deploy: 16 | resources: 17 | limits: 18 | cpus: "0.25" 19 | memory: "50MB" 20 | 21 | api02: 22 | <<: *api 23 | hostname: api02 24 | environment: 25 | PRIMARY: 1 26 | 27 | db: 28 | image: distanteagle16/alexdb 29 | user: www-data:www-data 30 | environment: 31 | SOCKET_PATH: /tmp/sockets/alexdb.sock 32 | DATA_PATH: /tmp 33 | RESET_FILES: 1 34 | deploy: 35 | resources: 36 | limits: 37 | cpus: "1" 38 | memory: "50MB" 39 | volumes: 40 | - sockets:/tmp/sockets 41 | - alexdb-storage:/tmp 42 | 43 | nginx: 44 | image: nginx:latest 45 | volumes: 46 | - ./nginx.conf:/etc/nginx/nginx.conf:ro 47 | - sockets:/tmp/sockets 48 | depends_on: 49 | - api01 50 | - api02 51 | ports: 52 | - "9999:9999" 53 | network_mode: host 54 | deploy: 55 | resources: 56 | limits: 57 | cpus: "0.2" 58 | memory: "50MB" 59 | 60 | volumes: 61 | sockets: 62 | alexdb-storage: 63 | -------------------------------------------------------------------------------- /init.sql: -------------------------------------------------------------------------------- 1 | CREATE UNLOGGED TABLE transacoes ( 2 | id INTEGER NOT NULL, 3 | id_cliente INTEGER NOT NULL, 4 | valor INTEGER NOT NULL, 5 | tipo CHAR(1) NOT NULL, 6 | descricao VARCHAR(10) NOT NULL, 7 | realizada_em TIMESTAMP NOT NULL DEFAULT NOW(), 8 | p INTEGER NOT NULL DEFAULT 0 9 | ); 10 | 11 | CREATE INDEX idx_extrato ON transacoes (id DESC); 12 | 13 | CREATE UNLOGGED TABLE saldos_limites ( 14 | id_cliente SERIAL PRIMARY KEY, 15 | limite INTEGER NOT NULL, 16 | saldo INTEGER NOT NULL 17 | ); 18 | 19 | CREATE INDEX idx_id_cliente ON saldos_limites USING HASH(id_cliente); 20 | 21 | CREATE PROCEDURE INSERIR_TRANSACAO( 22 | p_id_cliente INTEGER, 23 | p_valor INTEGER, 24 | p_tipo TEXT, 25 | p_descricao TEXT, 26 | INOUT v_saldo_atualizado INTEGER DEFAULT NULL, 27 | INOUT v_limite INTEGER DEFAULT NULL 28 | ) 29 | LANGUAGE plpgsql 30 | AS $$ 31 | BEGIN 32 | WITH 33 | UPDATE_SALDO AS ( 34 | UPDATE saldos_limites 35 | SET saldo = saldo + p_valor 36 | WHERE id_cliente = p_id_cliente AND saldo + p_valor >= - limite 37 | RETURNING saldo, limite 38 | ), 39 | INSERTED AS ( 40 | INSERT INTO transacoes (id_cliente, valor, tipo, descricao) 41 | SELECT p_id_cliente, ABS(p_valor), p_tipo, p_descricao 42 | FROM UPDATE_SALDO 43 | ) 44 | SELECT saldo, limite 45 | INTO v_saldo_atualizado, v_limite 46 | FROM UPDATE_SALDO; 47 | END; 48 | $$; 49 | 50 | CREATE PROCEDURE MOVIMENTAR_SALDOS() 51 | LANGUAGE plpgsql 52 | AS $$ 53 | BEGIN 54 | SELECT * FROM transacoes WHERE p = 0 FOR UPDATE; 55 | 56 | END; 57 | $$ LANGUAGE plpgsql; 58 | 59 | DO $$ 60 | BEGIN 61 | INSERT INTO saldos_limites (limite, saldo) 62 | VALUES 63 | (1000 * 100, 0), 64 | (800 * 100, 0), 65 | (10000 * 100, 0), 66 | (100000 * 100, 0), 67 | (5000 * 100, 0); 68 | END; 69 | $$; 70 | -------------------------------------------------------------------------------- /src/handlers/inserir_transacao.rs: -------------------------------------------------------------------------------- 1 | use std::sync::Arc; 2 | use axum::{body::Bytes, extract::{Path, State}, http::StatusCode, response::IntoResponse}; 3 | use serde::{Deserialize, Serialize}; 4 | 5 | use crate::{socket_client::movimenta_saldo, AppState}; 6 | 7 | #[derive(Deserialize)] 8 | struct TransacaoDTO { 9 | pub valor: i32, 10 | pub tipo: String, 11 | pub descricao: String, 12 | } 13 | 14 | #[derive(Serialize)] 15 | struct TransacaoResultDTO { 16 | pub saldo: i32, 17 | pub limite: i32 18 | } 19 | 20 | #[axum::debug_handler] 21 | pub async fn handler( 22 | Path(id_cliente): Path, 23 | State(app_state): State>, 24 | payload: Bytes, 25 | ) -> impl IntoResponse { 26 | 27 | if id_cliente > 5 { 28 | return (StatusCode::NOT_FOUND, String::new()); 29 | } 30 | 31 | let payload = match serde_json::from_slice::(&payload) { 32 | Ok(p) => p, 33 | Err(_) => return (StatusCode::UNPROCESSABLE_ENTITY, String::new()) 34 | }; 35 | 36 | let descricao_len = payload.descricao.len(); 37 | if descricao_len < 1 || descricao_len > 10 { 38 | return (StatusCode::UNPROCESSABLE_ENTITY, String::new()); 39 | } 40 | 41 | let valor = match payload.tipo.as_str() { 42 | "d" => -payload.valor, 43 | "c" => payload.valor, 44 | _ => return (StatusCode::UNPROCESSABLE_ENTITY, String::new()) 45 | }; 46 | let limite = app_state.limites.get(id_cliente - 1).unwrap(); 47 | 48 | match movimenta_saldo(&app_state.socket_client, id_cliente, valor, payload.tipo, payload.descricao).await { 49 | Ok(saldo) => 50 | (StatusCode::OK, format!("{{\"saldo\":{saldo},\"limite\":{limite}}}")), 51 | Err(_) => (StatusCode::UNPROCESSABLE_ENTITY, String::new()) 52 | } 53 | } -------------------------------------------------------------------------------- /src/main.rs: -------------------------------------------------------------------------------- 1 | use std::{env, sync::Arc}; 2 | 3 | use atomic_fd::AtomicFd; 4 | use axum::{routing::{get, post}, Router}; 5 | use http_body_util::Full; 6 | use hyperlocal::{UnixClientExt, UnixConnector}; 7 | use socket_client::create_atomic; 8 | 9 | mod handlers; 10 | mod socket_client; 11 | mod atomic_fd; 12 | 13 | struct AppState { 14 | socket_client: HyperClient, 15 | atomic_fd: scc::HashMap, 16 | limites: Vec 17 | } 18 | 19 | type HyperClient = hyper_util::client::legacy::Client>; 20 | 21 | #[tokio::main] 22 | async fn main() { 23 | 24 | let socket_client = HyperClient::unix(); 25 | let atomic_fd = scc::HashMap::new(); 26 | let limites = vec![100000, 80000, 1000000, 10000000, 500000]; 27 | let log_size = 72; 28 | let is_primary = env::var("PRIMARY").is_ok(); 29 | 30 | for (i, limite) in limites.iter().enumerate() { 31 | if is_primary { 32 | create_atomic(&socket_client, i + 1, *limite, log_size).await; 33 | } 34 | atomic_fd.insert_async(i + 1, AtomicFd::new(i + 1, log_size).await).await.unwrap(); 35 | } 36 | 37 | let app_state = Arc::new(AppState { 38 | socket_client, 39 | atomic_fd, 40 | limites 41 | }); 42 | 43 | let app = Router::new() 44 | .route("/clientes/:id/transacoes", post(handlers::inserir_transacao::handler)) 45 | .route("/clientes/:id/extrato", get(handlers::extrato::handler)) 46 | .with_state::<()>(app_state); 47 | 48 | let hostname = env::var("HOSTNAME").unwrap(); 49 | 50 | let sockets_dir = "/tmp/sockets"; 51 | let socket_path = format!("{sockets_dir}/{hostname}.sock"); 52 | match tokio::fs::remove_file(&socket_path).await { 53 | Err(e) => println!("warn: unable to unlink path {socket_path}: {e}"), 54 | _ => () 55 | }; 56 | 57 | let listener = std::os::unix::net::UnixListener::bind(&socket_path) 58 | .expect(format!("error listening to socket {socket_path}").as_str()); 59 | listener.set_nonblocking(true).unwrap(); 60 | 61 | let listener = tokio::net::UnixListener::from_std(listener) 62 | .expect("error parsing std listener"); 63 | 64 | axum::serve(listener, app.into_make_service()).await 65 | .expect("error serving app"); 66 | } 67 | -------------------------------------------------------------------------------- /src/atomic_fd.rs: -------------------------------------------------------------------------------- 1 | use tokio::{fs::{File, OpenOptions}, io::{AsyncReadExt, AsyncSeekExt}}; 2 | 3 | // {tx_id},{value},{updated_value},{datetime_rfc3339},{tipo},{descricao} 4 | pub type AtomicLog = (i32, i32, i32, String, String, String); 5 | 6 | #[derive(Debug)] 7 | pub struct AtomicFd { 8 | id: usize, 9 | log_size: usize 10 | } 11 | 12 | const DATA_PATH: &str = "/tmp"; 13 | 14 | impl AtomicFd { 15 | 16 | pub async fn new(id: usize, log_size: usize) -> AtomicFd { 17 | AtomicFd { 18 | id, 19 | log_size 20 | } 21 | } 22 | 23 | pub async fn get_logs_file(&mut self) -> File { 24 | OpenOptions::new() 25 | .read(true) 26 | .write(false) 27 | .open(format!("{DATA_PATH}/{}.log", self.id)).await.unwrap() 28 | } 29 | 30 | pub async fn get_logs(&mut self, mut logs: File, max: usize) -> Vec { 31 | let buffer_size = self.log_size * max; 32 | _ = logs.seek(std::io::SeekFrom::End(0)).await; 33 | let cursor_target = -(TryInto::::try_into(buffer_size)).unwrap(); 34 | if logs.seek(std::io::SeekFrom::Current(cursor_target)).await.is_err() { 35 | _ = logs.seek(std::io::SeekFrom::Start(0)).await; 36 | } 37 | let mut buf = vec![0u8; buffer_size - 1]; 38 | let bytes_read = logs.read(&mut buf).await.unwrap(); 39 | if bytes_read == 0 { 40 | return Vec::new() 41 | } 42 | let lines = String::from_utf8(buf).unwrap(); 43 | let lines = lines.trim_matches(char::from(0x0A)).split("\n"); 44 | let mut r = Vec::new(); 45 | for line in lines { 46 | let split = line.split(",").collect::>(); 47 | let txid = match split.get(0).unwrap().trim_matches(char::from(0)).parse::() { 48 | Ok(i) => i, 49 | Err(_) => { 50 | println!("warn: error parsing txid. line: {line}, bytes_read: {bytes_read}"); 51 | continue; 52 | } 53 | }; 54 | r.push(( 55 | txid, 56 | split.get(1).unwrap().parse::().unwrap(), 57 | split.get(2).unwrap().parse::().unwrap(), 58 | split.get(3).unwrap().to_string(), 59 | split.get(4).unwrap().to_string(), 60 | split.get(5).unwrap().to_string().trim_end().to_string(), 61 | )) 62 | } 63 | r 64 | } 65 | } -------------------------------------------------------------------------------- /src/handlers/extrato.rs: -------------------------------------------------------------------------------- 1 | use std::{sync::Arc, time::SystemTime}; 2 | 3 | use axum::{extract::{Path, State}, http::StatusCode, response::IntoResponse}; 4 | use chrono::{DateTime, Utc}; 5 | use serde::Serialize; 6 | 7 | use crate::{atomic_fd::AtomicLog, socket_client::obter_saldo, AppState}; 8 | 9 | #[derive(Serialize)] 10 | struct ExtratoDTO { 11 | pub saldo: ExtratoSaldoDTO, 12 | pub ultimas_transacoes: Vec 13 | } 14 | 15 | #[derive(Serialize)] 16 | struct ExtratoSaldoDTO { 17 | pub total: i32, 18 | pub data_extrato: String, 19 | pub limite: i32, 20 | } 21 | 22 | #[derive(Serialize)] 23 | struct ExtratoTransacaoDTO { 24 | pub valor: i32, 25 | pub tipo: String, 26 | pub descricao: String, 27 | pub realizada_em: String 28 | } 29 | 30 | pub fn parse_sys_time_as_string(system_time: SystemTime) -> String { 31 | DateTime::::from(system_time).format("%Y-%m-%dT%H:%M:%S%.6fZ").to_string() 32 | } 33 | 34 | impl ExtratoDTO { 35 | pub fn from(saldo: i32, limite: i32, extrato: Vec) -> ExtratoDTO { 36 | let mut ultimas_transacoes = Vec::new(); 37 | for (_txid, valor, _, realizada_em, tipo, descricao) in extrato { 38 | ultimas_transacoes.push(ExtratoTransacaoDTO { 39 | valor: valor.abs(), 40 | tipo, 41 | descricao, 42 | realizada_em 43 | }); 44 | } 45 | ExtratoDTO { 46 | saldo: ExtratoSaldoDTO { 47 | total: saldo, 48 | data_extrato: parse_sys_time_as_string(SystemTime::now()), 49 | limite 50 | }, 51 | ultimas_transacoes 52 | } 53 | } 54 | } 55 | 56 | pub async fn handler( 57 | Path(id_cliente): Path, 58 | State(app_state): State>, 59 | ) -> impl IntoResponse { 60 | 61 | if id_cliente > 5 { 62 | return (StatusCode::NOT_FOUND, String::new()); 63 | } 64 | 65 | let mut atomic_fd = app_state.atomic_fd.get_async(&id_cliente).await.unwrap(); 66 | let atomic_fd = atomic_fd.get_mut(); 67 | let limite = *app_state.limites.get(id_cliente - 1).unwrap(); 68 | let mut extrato = { 69 | let logs_file = atomic_fd.get_logs_file().await; 70 | atomic_fd.get_logs(logs_file, 10).await 71 | }; 72 | extrato.reverse(); 73 | let saldo = if extrato.is_empty() { 74 | obter_saldo(&app_state.socket_client, id_cliente).await 75 | } 76 | else { 77 | extrato.get(0).unwrap().2 78 | }; 79 | (StatusCode::OK, serde_json::to_string(&ExtratoDTO::from(saldo, limite, extrato)).unwrap()) 80 | } -------------------------------------------------------------------------------- /src/socket_client.rs: -------------------------------------------------------------------------------- 1 | use anyhow::Error; 2 | use axum::{body::Bytes, response::IntoResponse}; 3 | use http_body_util::{BodyExt, Full}; 4 | use hyper::Request; 5 | use hyperlocal::Uri; 6 | use serde_json::json; 7 | 8 | use crate::HyperClient; 9 | 10 | const SOCKET_PATH_BASE: &'static str = "/tmp/sockets/alexdb.sock"; 11 | 12 | async fn make_socket_request(client: &HyperClient, request: Request>) -> String { 13 | 14 | let mut response = client.request(request).await 15 | .expect("error getting socket response") 16 | .into_response(); 17 | 18 | let mut response_body = String::new(); 19 | while let Some(frame_result) = response.frame().await { 20 | let frame = frame_result.expect("error getting frame result"); 21 | 22 | if let Some(segment) = frame.data_ref() { 23 | response_body.push_str(&String::from_utf8_lossy(segment.iter().as_slice())); 24 | } 25 | } 26 | 27 | response_body 28 | } 29 | 30 | pub async fn create_atomic(client: &HyperClient, id_cliente: usize, limite: i32, log_size: usize) { 31 | 32 | let body = json!({ 33 | "id": id_cliente, 34 | "min_value": -limite, 35 | "log_size": log_size 36 | }); 37 | let body = serde_json::to_string(&body).unwrap(); 38 | let body = Full::new(Bytes::from(body)); 39 | 40 | let request = Request::builder() 41 | .method("POST") 42 | .uri(Uri::new(SOCKET_PATH_BASE, "/atomics")) 43 | .header("Content-Type", "application/json") 44 | .body(body) 45 | .expect("error building request (create_atomic)"); 46 | 47 | make_socket_request(client, request).await; 48 | } 49 | 50 | pub async fn obter_saldo(client: &HyperClient, id_cliente: usize) -> i32 { 51 | 52 | let request = Request::builder() 53 | .method("GET") 54 | .uri(Uri::new(SOCKET_PATH_BASE, format!("/atomics/{id_cliente}").as_str())) 55 | .body(Full::new(Bytes::new())) 56 | .expect("error building request (obter_saldo)"); 57 | 58 | let response = make_socket_request(client, request).await; 59 | 60 | response.parse::().unwrap() 61 | } 62 | 63 | pub async fn movimenta_saldo( 64 | client: &HyperClient, 65 | id_cliente: usize, 66 | valor: i32, 67 | tipo: String, 68 | descricao: String 69 | ) -> Result { 70 | 71 | let body = format!("{tipo},{descricao}"); 72 | let body = Full::new(Bytes::from(body)); 73 | let request = Request::builder() 74 | .method("POST") 75 | .uri(Uri::new(SOCKET_PATH_BASE, format!("/atomics/{id_cliente}/{valor}").as_str())) 76 | .body(body) 77 | .expect("error building request (movimenta_saldo)"); 78 | 79 | let response = make_socket_request(client, request).await; 80 | if response.is_empty() { 81 | Err(Error::msg("")) 82 | } 83 | else { 84 | Ok(response.parse::().unwrap()) 85 | } 86 | } -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "addr2line" 7 | version = "0.21.0" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" 10 | dependencies = [ 11 | "gimli", 12 | ] 13 | 14 | [[package]] 15 | name = "adler" 16 | version = "1.0.2" 17 | source = "registry+https://github.com/rust-lang/crates.io-index" 18 | checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" 19 | 20 | [[package]] 21 | name = "android-tzdata" 22 | version = "0.1.1" 23 | source = "registry+https://github.com/rust-lang/crates.io-index" 24 | checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" 25 | 26 | [[package]] 27 | name = "android_system_properties" 28 | version = "0.1.5" 29 | source = "registry+https://github.com/rust-lang/crates.io-index" 30 | checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" 31 | dependencies = [ 32 | "libc", 33 | ] 34 | 35 | [[package]] 36 | name = "anyhow" 37 | version = "1.0.79" 38 | source = "registry+https://github.com/rust-lang/crates.io-index" 39 | checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" 40 | 41 | [[package]] 42 | name = "async-trait" 43 | version = "0.1.77" 44 | source = "registry+https://github.com/rust-lang/crates.io-index" 45 | checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" 46 | dependencies = [ 47 | "proc-macro2", 48 | "quote", 49 | "syn", 50 | ] 51 | 52 | [[package]] 53 | name = "autocfg" 54 | version = "1.1.0" 55 | source = "registry+https://github.com/rust-lang/crates.io-index" 56 | checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" 57 | 58 | [[package]] 59 | name = "axum" 60 | version = "0.7.3" 61 | source = "git+https://github.com/tokio-rs/axum.git?branch=david/generic-serve#49f448280a6935f94520f0efe5c2b4006b740a91" 62 | dependencies = [ 63 | "async-trait", 64 | "axum-core", 65 | "axum-macros", 66 | "bytes", 67 | "futures-util", 68 | "http 1.0.0", 69 | "http-body 1.0.0", 70 | "http-body-util", 71 | "hyper 1.1.0", 72 | "hyper-util", 73 | "itoa", 74 | "matchit", 75 | "memchr", 76 | "mime", 77 | "percent-encoding", 78 | "pin-project-lite", 79 | "rustversion", 80 | "serde", 81 | "serde_json", 82 | "serde_path_to_error", 83 | "serde_urlencoded", 84 | "sync_wrapper", 85 | "tokio", 86 | "tower", 87 | "tower-layer", 88 | "tower-service", 89 | "tracing", 90 | ] 91 | 92 | [[package]] 93 | name = "axum-core" 94 | version = "0.4.2" 95 | source = "git+https://github.com/tokio-rs/axum.git?branch=david/generic-serve#49f448280a6935f94520f0efe5c2b4006b740a91" 96 | dependencies = [ 97 | "async-trait", 98 | "bytes", 99 | "futures-util", 100 | "http 1.0.0", 101 | "http-body 1.0.0", 102 | "http-body-util", 103 | "mime", 104 | "pin-project-lite", 105 | "rustversion", 106 | "sync_wrapper", 107 | "tower-layer", 108 | "tower-service", 109 | "tracing", 110 | ] 111 | 112 | [[package]] 113 | name = "axum-macros" 114 | version = "0.4.0" 115 | source = "git+https://github.com/tokio-rs/axum.git?branch=david/generic-serve#49f448280a6935f94520f0efe5c2b4006b740a91" 116 | dependencies = [ 117 | "heck", 118 | "proc-macro2", 119 | "quote", 120 | "syn", 121 | ] 122 | 123 | [[package]] 124 | name = "backtrace" 125 | version = "0.3.69" 126 | source = "registry+https://github.com/rust-lang/crates.io-index" 127 | checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" 128 | dependencies = [ 129 | "addr2line", 130 | "cc", 131 | "cfg-if", 132 | "libc", 133 | "miniz_oxide", 134 | "object", 135 | "rustc-demangle", 136 | ] 137 | 138 | [[package]] 139 | name = "base64" 140 | version = "0.21.7" 141 | source = "registry+https://github.com/rust-lang/crates.io-index" 142 | checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" 143 | 144 | [[package]] 145 | name = "bitflags" 146 | version = "1.3.2" 147 | source = "registry+https://github.com/rust-lang/crates.io-index" 148 | checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" 149 | 150 | [[package]] 151 | name = "bitflags" 152 | version = "2.4.2" 153 | source = "registry+https://github.com/rust-lang/crates.io-index" 154 | checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" 155 | 156 | [[package]] 157 | name = "bumpalo" 158 | version = "3.14.0" 159 | source = "registry+https://github.com/rust-lang/crates.io-index" 160 | checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" 161 | 162 | [[package]] 163 | name = "bytes" 164 | version = "1.5.0" 165 | source = "registry+https://github.com/rust-lang/crates.io-index" 166 | checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" 167 | 168 | [[package]] 169 | name = "cc" 170 | version = "1.0.83" 171 | source = "registry+https://github.com/rust-lang/crates.io-index" 172 | checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" 173 | dependencies = [ 174 | "libc", 175 | ] 176 | 177 | [[package]] 178 | name = "cfg-if" 179 | version = "1.0.0" 180 | source = "registry+https://github.com/rust-lang/crates.io-index" 181 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 182 | 183 | [[package]] 184 | name = "chrono" 185 | version = "0.4.33" 186 | source = "registry+https://github.com/rust-lang/crates.io-index" 187 | checksum = "9f13690e35a5e4ace198e7beea2895d29f3a9cc55015fcebe6336bd2010af9eb" 188 | dependencies = [ 189 | "android-tzdata", 190 | "iana-time-zone", 191 | "js-sys", 192 | "num-traits", 193 | "wasm-bindgen", 194 | "windows-targets 0.52.0", 195 | ] 196 | 197 | [[package]] 198 | name = "core-foundation" 199 | version = "0.9.4" 200 | source = "registry+https://github.com/rust-lang/crates.io-index" 201 | checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" 202 | dependencies = [ 203 | "core-foundation-sys", 204 | "libc", 205 | ] 206 | 207 | [[package]] 208 | name = "core-foundation-sys" 209 | version = "0.8.6" 210 | source = "registry+https://github.com/rust-lang/crates.io-index" 211 | checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" 212 | 213 | [[package]] 214 | name = "encoding_rs" 215 | version = "0.8.33" 216 | source = "registry+https://github.com/rust-lang/crates.io-index" 217 | checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" 218 | dependencies = [ 219 | "cfg-if", 220 | ] 221 | 222 | [[package]] 223 | name = "equivalent" 224 | version = "1.0.1" 225 | source = "registry+https://github.com/rust-lang/crates.io-index" 226 | checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" 227 | 228 | [[package]] 229 | name = "errno" 230 | version = "0.3.8" 231 | source = "registry+https://github.com/rust-lang/crates.io-index" 232 | checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" 233 | dependencies = [ 234 | "libc", 235 | "windows-sys 0.52.0", 236 | ] 237 | 238 | [[package]] 239 | name = "fastrand" 240 | version = "2.0.1" 241 | source = "registry+https://github.com/rust-lang/crates.io-index" 242 | checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" 243 | 244 | [[package]] 245 | name = "fnv" 246 | version = "1.0.7" 247 | source = "registry+https://github.com/rust-lang/crates.io-index" 248 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 249 | 250 | [[package]] 251 | name = "foreign-types" 252 | version = "0.3.2" 253 | source = "registry+https://github.com/rust-lang/crates.io-index" 254 | checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" 255 | dependencies = [ 256 | "foreign-types-shared", 257 | ] 258 | 259 | [[package]] 260 | name = "foreign-types-shared" 261 | version = "0.1.1" 262 | source = "registry+https://github.com/rust-lang/crates.io-index" 263 | checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" 264 | 265 | [[package]] 266 | name = "form_urlencoded" 267 | version = "1.2.1" 268 | source = "registry+https://github.com/rust-lang/crates.io-index" 269 | checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" 270 | dependencies = [ 271 | "percent-encoding", 272 | ] 273 | 274 | [[package]] 275 | name = "futures" 276 | version = "0.3.30" 277 | source = "registry+https://github.com/rust-lang/crates.io-index" 278 | checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" 279 | dependencies = [ 280 | "futures-channel", 281 | "futures-core", 282 | "futures-executor", 283 | "futures-io", 284 | "futures-sink", 285 | "futures-task", 286 | "futures-util", 287 | ] 288 | 289 | [[package]] 290 | name = "futures-channel" 291 | version = "0.3.30" 292 | source = "registry+https://github.com/rust-lang/crates.io-index" 293 | checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" 294 | dependencies = [ 295 | "futures-core", 296 | "futures-sink", 297 | ] 298 | 299 | [[package]] 300 | name = "futures-core" 301 | version = "0.3.30" 302 | source = "registry+https://github.com/rust-lang/crates.io-index" 303 | checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" 304 | 305 | [[package]] 306 | name = "futures-executor" 307 | version = "0.3.30" 308 | source = "registry+https://github.com/rust-lang/crates.io-index" 309 | checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" 310 | dependencies = [ 311 | "futures-core", 312 | "futures-task", 313 | "futures-util", 314 | ] 315 | 316 | [[package]] 317 | name = "futures-io" 318 | version = "0.3.30" 319 | source = "registry+https://github.com/rust-lang/crates.io-index" 320 | checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" 321 | 322 | [[package]] 323 | name = "futures-macro" 324 | version = "0.3.30" 325 | source = "registry+https://github.com/rust-lang/crates.io-index" 326 | checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" 327 | dependencies = [ 328 | "proc-macro2", 329 | "quote", 330 | "syn", 331 | ] 332 | 333 | [[package]] 334 | name = "futures-sink" 335 | version = "0.3.30" 336 | source = "registry+https://github.com/rust-lang/crates.io-index" 337 | checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" 338 | 339 | [[package]] 340 | name = "futures-task" 341 | version = "0.3.30" 342 | source = "registry+https://github.com/rust-lang/crates.io-index" 343 | checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" 344 | 345 | [[package]] 346 | name = "futures-util" 347 | version = "0.3.30" 348 | source = "registry+https://github.com/rust-lang/crates.io-index" 349 | checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" 350 | dependencies = [ 351 | "futures-channel", 352 | "futures-core", 353 | "futures-io", 354 | "futures-macro", 355 | "futures-sink", 356 | "futures-task", 357 | "memchr", 358 | "pin-project-lite", 359 | "pin-utils", 360 | "slab", 361 | ] 362 | 363 | [[package]] 364 | name = "gimli" 365 | version = "0.28.1" 366 | source = "registry+https://github.com/rust-lang/crates.io-index" 367 | checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" 368 | 369 | [[package]] 370 | name = "h2" 371 | version = "0.3.24" 372 | source = "registry+https://github.com/rust-lang/crates.io-index" 373 | checksum = "bb2c4422095b67ee78da96fbb51a4cc413b3b25883c7717ff7ca1ab31022c9c9" 374 | dependencies = [ 375 | "bytes", 376 | "fnv", 377 | "futures-core", 378 | "futures-sink", 379 | "futures-util", 380 | "http 0.2.11", 381 | "indexmap", 382 | "slab", 383 | "tokio", 384 | "tokio-util", 385 | "tracing", 386 | ] 387 | 388 | [[package]] 389 | name = "h2" 390 | version = "0.4.2" 391 | source = "registry+https://github.com/rust-lang/crates.io-index" 392 | checksum = "31d030e59af851932b72ceebadf4a2b5986dba4c3b99dd2493f8273a0f151943" 393 | dependencies = [ 394 | "bytes", 395 | "fnv", 396 | "futures-core", 397 | "futures-sink", 398 | "futures-util", 399 | "http 1.0.0", 400 | "indexmap", 401 | "slab", 402 | "tokio", 403 | "tokio-util", 404 | "tracing", 405 | ] 406 | 407 | [[package]] 408 | name = "hashbrown" 409 | version = "0.14.3" 410 | source = "registry+https://github.com/rust-lang/crates.io-index" 411 | checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" 412 | 413 | [[package]] 414 | name = "heck" 415 | version = "0.4.1" 416 | source = "registry+https://github.com/rust-lang/crates.io-index" 417 | checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" 418 | 419 | [[package]] 420 | name = "hermit-abi" 421 | version = "0.3.4" 422 | source = "registry+https://github.com/rust-lang/crates.io-index" 423 | checksum = "5d3d0e0f38255e7fa3cf31335b3a56f05febd18025f4db5ef7a0cfb4f8da651f" 424 | 425 | [[package]] 426 | name = "hex" 427 | version = "0.4.3" 428 | source = "registry+https://github.com/rust-lang/crates.io-index" 429 | checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" 430 | 431 | [[package]] 432 | name = "http" 433 | version = "0.2.11" 434 | source = "registry+https://github.com/rust-lang/crates.io-index" 435 | checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" 436 | dependencies = [ 437 | "bytes", 438 | "fnv", 439 | "itoa", 440 | ] 441 | 442 | [[package]] 443 | name = "http" 444 | version = "1.0.0" 445 | source = "registry+https://github.com/rust-lang/crates.io-index" 446 | checksum = "b32afd38673a8016f7c9ae69e5af41a58f81b1d31689040f2f1959594ce194ea" 447 | dependencies = [ 448 | "bytes", 449 | "fnv", 450 | "itoa", 451 | ] 452 | 453 | [[package]] 454 | name = "http-body" 455 | version = "0.4.6" 456 | source = "registry+https://github.com/rust-lang/crates.io-index" 457 | checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" 458 | dependencies = [ 459 | "bytes", 460 | "http 0.2.11", 461 | "pin-project-lite", 462 | ] 463 | 464 | [[package]] 465 | name = "http-body" 466 | version = "1.0.0" 467 | source = "registry+https://github.com/rust-lang/crates.io-index" 468 | checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643" 469 | dependencies = [ 470 | "bytes", 471 | "http 1.0.0", 472 | ] 473 | 474 | [[package]] 475 | name = "http-body-util" 476 | version = "0.1.0" 477 | source = "registry+https://github.com/rust-lang/crates.io-index" 478 | checksum = "41cb79eb393015dadd30fc252023adb0b2400a0caee0fa2a077e6e21a551e840" 479 | dependencies = [ 480 | "bytes", 481 | "futures-util", 482 | "http 1.0.0", 483 | "http-body 1.0.0", 484 | "pin-project-lite", 485 | ] 486 | 487 | [[package]] 488 | name = "httparse" 489 | version = "1.8.0" 490 | source = "registry+https://github.com/rust-lang/crates.io-index" 491 | checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" 492 | 493 | [[package]] 494 | name = "httpdate" 495 | version = "1.0.3" 496 | source = "registry+https://github.com/rust-lang/crates.io-index" 497 | checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" 498 | 499 | [[package]] 500 | name = "hyper" 501 | version = "0.14.28" 502 | source = "registry+https://github.com/rust-lang/crates.io-index" 503 | checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" 504 | dependencies = [ 505 | "bytes", 506 | "futures-channel", 507 | "futures-core", 508 | "futures-util", 509 | "h2 0.3.24", 510 | "http 0.2.11", 511 | "http-body 0.4.6", 512 | "httparse", 513 | "httpdate", 514 | "itoa", 515 | "pin-project-lite", 516 | "socket2", 517 | "tokio", 518 | "tower-service", 519 | "tracing", 520 | "want", 521 | ] 522 | 523 | [[package]] 524 | name = "hyper" 525 | version = "1.1.0" 526 | source = "registry+https://github.com/rust-lang/crates.io-index" 527 | checksum = "fb5aa53871fc917b1a9ed87b683a5d86db645e23acb32c2e0785a353e522fb75" 528 | dependencies = [ 529 | "bytes", 530 | "futures-channel", 531 | "futures-util", 532 | "h2 0.4.2", 533 | "http 1.0.0", 534 | "http-body 1.0.0", 535 | "httparse", 536 | "httpdate", 537 | "itoa", 538 | "pin-project-lite", 539 | "tokio", 540 | "want", 541 | ] 542 | 543 | [[package]] 544 | name = "hyper-tls" 545 | version = "0.5.0" 546 | source = "registry+https://github.com/rust-lang/crates.io-index" 547 | checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" 548 | dependencies = [ 549 | "bytes", 550 | "hyper 0.14.28", 551 | "native-tls", 552 | "tokio", 553 | "tokio-native-tls", 554 | ] 555 | 556 | [[package]] 557 | name = "hyper-util" 558 | version = "0.1.3" 559 | source = "registry+https://github.com/rust-lang/crates.io-index" 560 | checksum = "ca38ef113da30126bbff9cd1705f9273e15d45498615d138b0c20279ac7a76aa" 561 | dependencies = [ 562 | "bytes", 563 | "futures-channel", 564 | "futures-util", 565 | "http 1.0.0", 566 | "http-body 1.0.0", 567 | "hyper 1.1.0", 568 | "pin-project-lite", 569 | "socket2", 570 | "tokio", 571 | "tower", 572 | "tower-service", 573 | "tracing", 574 | ] 575 | 576 | [[package]] 577 | name = "hyperlocal" 578 | version = "0.9.0-alpha" 579 | source = "git+https://github.com/softprops/hyperlocal.git?rev=34dc8579d74f96b68ddbd55582c76019ae18cfdc#34dc8579d74f96b68ddbd55582c76019ae18cfdc" 580 | dependencies = [ 581 | "hex", 582 | "http-body-util", 583 | "hyper 1.1.0", 584 | "hyper-util", 585 | "pin-project-lite", 586 | "tokio", 587 | "tower-service", 588 | ] 589 | 590 | [[package]] 591 | name = "iana-time-zone" 592 | version = "0.1.60" 593 | source = "registry+https://github.com/rust-lang/crates.io-index" 594 | checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" 595 | dependencies = [ 596 | "android_system_properties", 597 | "core-foundation-sys", 598 | "iana-time-zone-haiku", 599 | "js-sys", 600 | "wasm-bindgen", 601 | "windows-core", 602 | ] 603 | 604 | [[package]] 605 | name = "iana-time-zone-haiku" 606 | version = "0.1.2" 607 | source = "registry+https://github.com/rust-lang/crates.io-index" 608 | checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" 609 | dependencies = [ 610 | "cc", 611 | ] 612 | 613 | [[package]] 614 | name = "idna" 615 | version = "0.5.0" 616 | source = "registry+https://github.com/rust-lang/crates.io-index" 617 | checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" 618 | dependencies = [ 619 | "unicode-bidi", 620 | "unicode-normalization", 621 | ] 622 | 623 | [[package]] 624 | name = "indexmap" 625 | version = "2.2.2" 626 | source = "registry+https://github.com/rust-lang/crates.io-index" 627 | checksum = "824b2ae422412366ba479e8111fd301f7b5faece8149317bb81925979a53f520" 628 | dependencies = [ 629 | "equivalent", 630 | "hashbrown", 631 | ] 632 | 633 | [[package]] 634 | name = "ipnet" 635 | version = "2.9.0" 636 | source = "registry+https://github.com/rust-lang/crates.io-index" 637 | checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" 638 | 639 | [[package]] 640 | name = "itoa" 641 | version = "1.0.10" 642 | source = "registry+https://github.com/rust-lang/crates.io-index" 643 | checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" 644 | 645 | [[package]] 646 | name = "js-sys" 647 | version = "0.3.67" 648 | source = "registry+https://github.com/rust-lang/crates.io-index" 649 | checksum = "9a1d36f1235bc969acba30b7f5990b864423a6068a10f7c90ae8f0112e3a59d1" 650 | dependencies = [ 651 | "wasm-bindgen", 652 | ] 653 | 654 | [[package]] 655 | name = "lazy_static" 656 | version = "1.4.0" 657 | source = "registry+https://github.com/rust-lang/crates.io-index" 658 | checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 659 | 660 | [[package]] 661 | name = "libc" 662 | version = "0.2.152" 663 | source = "registry+https://github.com/rust-lang/crates.io-index" 664 | checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" 665 | 666 | [[package]] 667 | name = "linux-raw-sys" 668 | version = "0.4.13" 669 | source = "registry+https://github.com/rust-lang/crates.io-index" 670 | checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" 671 | 672 | [[package]] 673 | name = "lock_api" 674 | version = "0.4.11" 675 | source = "registry+https://github.com/rust-lang/crates.io-index" 676 | checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" 677 | dependencies = [ 678 | "autocfg", 679 | "scopeguard", 680 | ] 681 | 682 | [[package]] 683 | name = "log" 684 | version = "0.4.20" 685 | source = "registry+https://github.com/rust-lang/crates.io-index" 686 | checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" 687 | 688 | [[package]] 689 | name = "matchit" 690 | version = "0.7.3" 691 | source = "registry+https://github.com/rust-lang/crates.io-index" 692 | checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" 693 | 694 | [[package]] 695 | name = "memchr" 696 | version = "2.7.1" 697 | source = "registry+https://github.com/rust-lang/crates.io-index" 698 | checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" 699 | 700 | [[package]] 701 | name = "mime" 702 | version = "0.3.17" 703 | source = "registry+https://github.com/rust-lang/crates.io-index" 704 | checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" 705 | 706 | [[package]] 707 | name = "miniz_oxide" 708 | version = "0.7.1" 709 | source = "registry+https://github.com/rust-lang/crates.io-index" 710 | checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" 711 | dependencies = [ 712 | "adler", 713 | ] 714 | 715 | [[package]] 716 | name = "mio" 717 | version = "0.8.10" 718 | source = "registry+https://github.com/rust-lang/crates.io-index" 719 | checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" 720 | dependencies = [ 721 | "libc", 722 | "wasi", 723 | "windows-sys 0.48.0", 724 | ] 725 | 726 | [[package]] 727 | name = "native-tls" 728 | version = "0.2.11" 729 | source = "registry+https://github.com/rust-lang/crates.io-index" 730 | checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" 731 | dependencies = [ 732 | "lazy_static", 733 | "libc", 734 | "log", 735 | "openssl", 736 | "openssl-probe", 737 | "openssl-sys", 738 | "schannel", 739 | "security-framework", 740 | "security-framework-sys", 741 | "tempfile", 742 | ] 743 | 744 | [[package]] 745 | name = "num-traits" 746 | version = "0.2.17" 747 | source = "registry+https://github.com/rust-lang/crates.io-index" 748 | checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" 749 | dependencies = [ 750 | "autocfg", 751 | ] 752 | 753 | [[package]] 754 | name = "num_cpus" 755 | version = "1.16.0" 756 | source = "registry+https://github.com/rust-lang/crates.io-index" 757 | checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" 758 | dependencies = [ 759 | "hermit-abi", 760 | "libc", 761 | ] 762 | 763 | [[package]] 764 | name = "object" 765 | version = "0.32.2" 766 | source = "registry+https://github.com/rust-lang/crates.io-index" 767 | checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" 768 | dependencies = [ 769 | "memchr", 770 | ] 771 | 772 | [[package]] 773 | name = "once_cell" 774 | version = "1.19.0" 775 | source = "registry+https://github.com/rust-lang/crates.io-index" 776 | checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" 777 | 778 | [[package]] 779 | name = "openssl" 780 | version = "0.10.63" 781 | source = "registry+https://github.com/rust-lang/crates.io-index" 782 | checksum = "15c9d69dd87a29568d4d017cfe8ec518706046a05184e5aea92d0af890b803c8" 783 | dependencies = [ 784 | "bitflags 2.4.2", 785 | "cfg-if", 786 | "foreign-types", 787 | "libc", 788 | "once_cell", 789 | "openssl-macros", 790 | "openssl-sys", 791 | ] 792 | 793 | [[package]] 794 | name = "openssl-macros" 795 | version = "0.1.1" 796 | source = "registry+https://github.com/rust-lang/crates.io-index" 797 | checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" 798 | dependencies = [ 799 | "proc-macro2", 800 | "quote", 801 | "syn", 802 | ] 803 | 804 | [[package]] 805 | name = "openssl-probe" 806 | version = "0.1.5" 807 | source = "registry+https://github.com/rust-lang/crates.io-index" 808 | checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" 809 | 810 | [[package]] 811 | name = "openssl-sys" 812 | version = "0.9.99" 813 | source = "registry+https://github.com/rust-lang/crates.io-index" 814 | checksum = "22e1bf214306098e4832460f797824c05d25aacdf896f64a985fb0fd992454ae" 815 | dependencies = [ 816 | "cc", 817 | "libc", 818 | "pkg-config", 819 | "vcpkg", 820 | ] 821 | 822 | [[package]] 823 | name = "parking_lot" 824 | version = "0.12.1" 825 | source = "registry+https://github.com/rust-lang/crates.io-index" 826 | checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" 827 | dependencies = [ 828 | "lock_api", 829 | "parking_lot_core", 830 | ] 831 | 832 | [[package]] 833 | name = "parking_lot_core" 834 | version = "0.9.9" 835 | source = "registry+https://github.com/rust-lang/crates.io-index" 836 | checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" 837 | dependencies = [ 838 | "cfg-if", 839 | "libc", 840 | "redox_syscall", 841 | "smallvec", 842 | "windows-targets 0.48.5", 843 | ] 844 | 845 | [[package]] 846 | name = "percent-encoding" 847 | version = "2.3.1" 848 | source = "registry+https://github.com/rust-lang/crates.io-index" 849 | checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" 850 | 851 | [[package]] 852 | name = "pin-project" 853 | version = "1.1.3" 854 | source = "registry+https://github.com/rust-lang/crates.io-index" 855 | checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" 856 | dependencies = [ 857 | "pin-project-internal", 858 | ] 859 | 860 | [[package]] 861 | name = "pin-project-internal" 862 | version = "1.1.3" 863 | source = "registry+https://github.com/rust-lang/crates.io-index" 864 | checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" 865 | dependencies = [ 866 | "proc-macro2", 867 | "quote", 868 | "syn", 869 | ] 870 | 871 | [[package]] 872 | name = "pin-project-lite" 873 | version = "0.2.13" 874 | source = "registry+https://github.com/rust-lang/crates.io-index" 875 | checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" 876 | 877 | [[package]] 878 | name = "pin-utils" 879 | version = "0.1.0" 880 | source = "registry+https://github.com/rust-lang/crates.io-index" 881 | checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" 882 | 883 | [[package]] 884 | name = "pkg-config" 885 | version = "0.3.29" 886 | source = "registry+https://github.com/rust-lang/crates.io-index" 887 | checksum = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb" 888 | 889 | [[package]] 890 | name = "proc-macro2" 891 | version = "1.0.78" 892 | source = "registry+https://github.com/rust-lang/crates.io-index" 893 | checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" 894 | dependencies = [ 895 | "unicode-ident", 896 | ] 897 | 898 | [[package]] 899 | name = "quote" 900 | version = "1.0.35" 901 | source = "registry+https://github.com/rust-lang/crates.io-index" 902 | checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" 903 | dependencies = [ 904 | "proc-macro2", 905 | ] 906 | 907 | [[package]] 908 | name = "redox_syscall" 909 | version = "0.4.1" 910 | source = "registry+https://github.com/rust-lang/crates.io-index" 911 | checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" 912 | dependencies = [ 913 | "bitflags 1.3.2", 914 | ] 915 | 916 | [[package]] 917 | name = "reqwest" 918 | version = "0.11.24" 919 | source = "registry+https://github.com/rust-lang/crates.io-index" 920 | checksum = "c6920094eb85afde5e4a138be3f2de8bbdf28000f0029e72c45025a56b042251" 921 | dependencies = [ 922 | "base64", 923 | "bytes", 924 | "encoding_rs", 925 | "futures-core", 926 | "futures-util", 927 | "h2 0.3.24", 928 | "http 0.2.11", 929 | "http-body 0.4.6", 930 | "hyper 0.14.28", 931 | "hyper-tls", 932 | "ipnet", 933 | "js-sys", 934 | "log", 935 | "mime", 936 | "native-tls", 937 | "once_cell", 938 | "percent-encoding", 939 | "pin-project-lite", 940 | "rustls-pemfile", 941 | "serde", 942 | "serde_json", 943 | "serde_urlencoded", 944 | "sync_wrapper", 945 | "system-configuration", 946 | "tokio", 947 | "tokio-native-tls", 948 | "tower-service", 949 | "url", 950 | "wasm-bindgen", 951 | "wasm-bindgen-futures", 952 | "web-sys", 953 | "winreg", 954 | ] 955 | 956 | [[package]] 957 | name = "rinha-backend-rust-2" 958 | version = "0.1.0" 959 | dependencies = [ 960 | "anyhow", 961 | "axum", 962 | "chrono", 963 | "futures", 964 | "http-body-util", 965 | "hyper 1.1.0", 966 | "hyper-util", 967 | "hyperlocal", 968 | "reqwest", 969 | "scc", 970 | "serde", 971 | "serde_json", 972 | "tokio", 973 | ] 974 | 975 | [[package]] 976 | name = "rustc-demangle" 977 | version = "0.1.23" 978 | source = "registry+https://github.com/rust-lang/crates.io-index" 979 | checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" 980 | 981 | [[package]] 982 | name = "rustix" 983 | version = "0.38.31" 984 | source = "registry+https://github.com/rust-lang/crates.io-index" 985 | checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" 986 | dependencies = [ 987 | "bitflags 2.4.2", 988 | "errno", 989 | "libc", 990 | "linux-raw-sys", 991 | "windows-sys 0.52.0", 992 | ] 993 | 994 | [[package]] 995 | name = "rustls-pemfile" 996 | version = "1.0.4" 997 | source = "registry+https://github.com/rust-lang/crates.io-index" 998 | checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" 999 | dependencies = [ 1000 | "base64", 1001 | ] 1002 | 1003 | [[package]] 1004 | name = "rustversion" 1005 | version = "1.0.14" 1006 | source = "registry+https://github.com/rust-lang/crates.io-index" 1007 | checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" 1008 | 1009 | [[package]] 1010 | name = "ryu" 1011 | version = "1.0.16" 1012 | source = "registry+https://github.com/rust-lang/crates.io-index" 1013 | checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" 1014 | 1015 | [[package]] 1016 | name = "scc" 1017 | version = "2.0.16" 1018 | source = "registry+https://github.com/rust-lang/crates.io-index" 1019 | checksum = "676aa089f19bc2dd9932c8ac6460134d63e30829cb49541a424d80e14083037e" 1020 | 1021 | [[package]] 1022 | name = "schannel" 1023 | version = "0.1.23" 1024 | source = "registry+https://github.com/rust-lang/crates.io-index" 1025 | checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" 1026 | dependencies = [ 1027 | "windows-sys 0.52.0", 1028 | ] 1029 | 1030 | [[package]] 1031 | name = "scopeguard" 1032 | version = "1.2.0" 1033 | source = "registry+https://github.com/rust-lang/crates.io-index" 1034 | checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" 1035 | 1036 | [[package]] 1037 | name = "security-framework" 1038 | version = "2.9.2" 1039 | source = "registry+https://github.com/rust-lang/crates.io-index" 1040 | checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" 1041 | dependencies = [ 1042 | "bitflags 1.3.2", 1043 | "core-foundation", 1044 | "core-foundation-sys", 1045 | "libc", 1046 | "security-framework-sys", 1047 | ] 1048 | 1049 | [[package]] 1050 | name = "security-framework-sys" 1051 | version = "2.9.1" 1052 | source = "registry+https://github.com/rust-lang/crates.io-index" 1053 | checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" 1054 | dependencies = [ 1055 | "core-foundation-sys", 1056 | "libc", 1057 | ] 1058 | 1059 | [[package]] 1060 | name = "serde" 1061 | version = "1.0.195" 1062 | source = "registry+https://github.com/rust-lang/crates.io-index" 1063 | checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02" 1064 | dependencies = [ 1065 | "serde_derive", 1066 | ] 1067 | 1068 | [[package]] 1069 | name = "serde_derive" 1070 | version = "1.0.195" 1071 | source = "registry+https://github.com/rust-lang/crates.io-index" 1072 | checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c" 1073 | dependencies = [ 1074 | "proc-macro2", 1075 | "quote", 1076 | "syn", 1077 | ] 1078 | 1079 | [[package]] 1080 | name = "serde_json" 1081 | version = "1.0.113" 1082 | source = "registry+https://github.com/rust-lang/crates.io-index" 1083 | checksum = "69801b70b1c3dac963ecb03a364ba0ceda9cf60c71cfe475e99864759c8b8a79" 1084 | dependencies = [ 1085 | "itoa", 1086 | "ryu", 1087 | "serde", 1088 | ] 1089 | 1090 | [[package]] 1091 | name = "serde_path_to_error" 1092 | version = "0.1.15" 1093 | source = "registry+https://github.com/rust-lang/crates.io-index" 1094 | checksum = "ebd154a240de39fdebcf5775d2675c204d7c13cf39a4c697be6493c8e734337c" 1095 | dependencies = [ 1096 | "itoa", 1097 | "serde", 1098 | ] 1099 | 1100 | [[package]] 1101 | name = "serde_urlencoded" 1102 | version = "0.7.1" 1103 | source = "registry+https://github.com/rust-lang/crates.io-index" 1104 | checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" 1105 | dependencies = [ 1106 | "form_urlencoded", 1107 | "itoa", 1108 | "ryu", 1109 | "serde", 1110 | ] 1111 | 1112 | [[package]] 1113 | name = "signal-hook-registry" 1114 | version = "1.4.1" 1115 | source = "registry+https://github.com/rust-lang/crates.io-index" 1116 | checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" 1117 | dependencies = [ 1118 | "libc", 1119 | ] 1120 | 1121 | [[package]] 1122 | name = "slab" 1123 | version = "0.4.9" 1124 | source = "registry+https://github.com/rust-lang/crates.io-index" 1125 | checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" 1126 | dependencies = [ 1127 | "autocfg", 1128 | ] 1129 | 1130 | [[package]] 1131 | name = "smallvec" 1132 | version = "1.13.1" 1133 | source = "registry+https://github.com/rust-lang/crates.io-index" 1134 | checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" 1135 | 1136 | [[package]] 1137 | name = "socket2" 1138 | version = "0.5.5" 1139 | source = "registry+https://github.com/rust-lang/crates.io-index" 1140 | checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" 1141 | dependencies = [ 1142 | "libc", 1143 | "windows-sys 0.48.0", 1144 | ] 1145 | 1146 | [[package]] 1147 | name = "syn" 1148 | version = "2.0.48" 1149 | source = "registry+https://github.com/rust-lang/crates.io-index" 1150 | checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" 1151 | dependencies = [ 1152 | "proc-macro2", 1153 | "quote", 1154 | "unicode-ident", 1155 | ] 1156 | 1157 | [[package]] 1158 | name = "sync_wrapper" 1159 | version = "0.1.2" 1160 | source = "registry+https://github.com/rust-lang/crates.io-index" 1161 | checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" 1162 | 1163 | [[package]] 1164 | name = "system-configuration" 1165 | version = "0.5.1" 1166 | source = "registry+https://github.com/rust-lang/crates.io-index" 1167 | checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" 1168 | dependencies = [ 1169 | "bitflags 1.3.2", 1170 | "core-foundation", 1171 | "system-configuration-sys", 1172 | ] 1173 | 1174 | [[package]] 1175 | name = "system-configuration-sys" 1176 | version = "0.5.0" 1177 | source = "registry+https://github.com/rust-lang/crates.io-index" 1178 | checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" 1179 | dependencies = [ 1180 | "core-foundation-sys", 1181 | "libc", 1182 | ] 1183 | 1184 | [[package]] 1185 | name = "tempfile" 1186 | version = "3.10.0" 1187 | source = "registry+https://github.com/rust-lang/crates.io-index" 1188 | checksum = "a365e8cd18e44762ef95d87f284f4b5cd04107fec2ff3052bd6a3e6069669e67" 1189 | dependencies = [ 1190 | "cfg-if", 1191 | "fastrand", 1192 | "rustix", 1193 | "windows-sys 0.52.0", 1194 | ] 1195 | 1196 | [[package]] 1197 | name = "tinyvec" 1198 | version = "1.6.0" 1199 | source = "registry+https://github.com/rust-lang/crates.io-index" 1200 | checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" 1201 | dependencies = [ 1202 | "tinyvec_macros", 1203 | ] 1204 | 1205 | [[package]] 1206 | name = "tinyvec_macros" 1207 | version = "0.1.1" 1208 | source = "registry+https://github.com/rust-lang/crates.io-index" 1209 | checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" 1210 | 1211 | [[package]] 1212 | name = "tokio" 1213 | version = "1.35.1" 1214 | source = "registry+https://github.com/rust-lang/crates.io-index" 1215 | checksum = "c89b4efa943be685f629b149f53829423f8f5531ea21249408e8e2f8671ec104" 1216 | dependencies = [ 1217 | "backtrace", 1218 | "bytes", 1219 | "libc", 1220 | "mio", 1221 | "num_cpus", 1222 | "parking_lot", 1223 | "pin-project-lite", 1224 | "signal-hook-registry", 1225 | "socket2", 1226 | "tokio-macros", 1227 | "windows-sys 0.48.0", 1228 | ] 1229 | 1230 | [[package]] 1231 | name = "tokio-macros" 1232 | version = "2.2.0" 1233 | source = "registry+https://github.com/rust-lang/crates.io-index" 1234 | checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" 1235 | dependencies = [ 1236 | "proc-macro2", 1237 | "quote", 1238 | "syn", 1239 | ] 1240 | 1241 | [[package]] 1242 | name = "tokio-native-tls" 1243 | version = "0.3.1" 1244 | source = "registry+https://github.com/rust-lang/crates.io-index" 1245 | checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" 1246 | dependencies = [ 1247 | "native-tls", 1248 | "tokio", 1249 | ] 1250 | 1251 | [[package]] 1252 | name = "tokio-util" 1253 | version = "0.7.10" 1254 | source = "registry+https://github.com/rust-lang/crates.io-index" 1255 | checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" 1256 | dependencies = [ 1257 | "bytes", 1258 | "futures-core", 1259 | "futures-sink", 1260 | "pin-project-lite", 1261 | "tokio", 1262 | "tracing", 1263 | ] 1264 | 1265 | [[package]] 1266 | name = "tower" 1267 | version = "0.4.13" 1268 | source = "registry+https://github.com/rust-lang/crates.io-index" 1269 | checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" 1270 | dependencies = [ 1271 | "futures-core", 1272 | "futures-util", 1273 | "pin-project", 1274 | "pin-project-lite", 1275 | "tokio", 1276 | "tower-layer", 1277 | "tower-service", 1278 | "tracing", 1279 | ] 1280 | 1281 | [[package]] 1282 | name = "tower-layer" 1283 | version = "0.3.2" 1284 | source = "registry+https://github.com/rust-lang/crates.io-index" 1285 | checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" 1286 | 1287 | [[package]] 1288 | name = "tower-service" 1289 | version = "0.3.2" 1290 | source = "registry+https://github.com/rust-lang/crates.io-index" 1291 | checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" 1292 | 1293 | [[package]] 1294 | name = "tracing" 1295 | version = "0.1.40" 1296 | source = "registry+https://github.com/rust-lang/crates.io-index" 1297 | checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" 1298 | dependencies = [ 1299 | "log", 1300 | "pin-project-lite", 1301 | "tracing-core", 1302 | ] 1303 | 1304 | [[package]] 1305 | name = "tracing-core" 1306 | version = "0.1.32" 1307 | source = "registry+https://github.com/rust-lang/crates.io-index" 1308 | checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" 1309 | dependencies = [ 1310 | "once_cell", 1311 | ] 1312 | 1313 | [[package]] 1314 | name = "try-lock" 1315 | version = "0.2.5" 1316 | source = "registry+https://github.com/rust-lang/crates.io-index" 1317 | checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" 1318 | 1319 | [[package]] 1320 | name = "unicode-bidi" 1321 | version = "0.3.15" 1322 | source = "registry+https://github.com/rust-lang/crates.io-index" 1323 | checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" 1324 | 1325 | [[package]] 1326 | name = "unicode-ident" 1327 | version = "1.0.12" 1328 | source = "registry+https://github.com/rust-lang/crates.io-index" 1329 | checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" 1330 | 1331 | [[package]] 1332 | name = "unicode-normalization" 1333 | version = "0.1.22" 1334 | source = "registry+https://github.com/rust-lang/crates.io-index" 1335 | checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" 1336 | dependencies = [ 1337 | "tinyvec", 1338 | ] 1339 | 1340 | [[package]] 1341 | name = "url" 1342 | version = "2.5.0" 1343 | source = "registry+https://github.com/rust-lang/crates.io-index" 1344 | checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" 1345 | dependencies = [ 1346 | "form_urlencoded", 1347 | "idna", 1348 | "percent-encoding", 1349 | ] 1350 | 1351 | [[package]] 1352 | name = "vcpkg" 1353 | version = "0.2.15" 1354 | source = "registry+https://github.com/rust-lang/crates.io-index" 1355 | checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" 1356 | 1357 | [[package]] 1358 | name = "want" 1359 | version = "0.3.1" 1360 | source = "registry+https://github.com/rust-lang/crates.io-index" 1361 | checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" 1362 | dependencies = [ 1363 | "try-lock", 1364 | ] 1365 | 1366 | [[package]] 1367 | name = "wasi" 1368 | version = "0.11.0+wasi-snapshot-preview1" 1369 | source = "registry+https://github.com/rust-lang/crates.io-index" 1370 | checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" 1371 | 1372 | [[package]] 1373 | name = "wasm-bindgen" 1374 | version = "0.2.90" 1375 | source = "registry+https://github.com/rust-lang/crates.io-index" 1376 | checksum = "b1223296a201415c7fad14792dbefaace9bd52b62d33453ade1c5b5f07555406" 1377 | dependencies = [ 1378 | "cfg-if", 1379 | "wasm-bindgen-macro", 1380 | ] 1381 | 1382 | [[package]] 1383 | name = "wasm-bindgen-backend" 1384 | version = "0.2.90" 1385 | source = "registry+https://github.com/rust-lang/crates.io-index" 1386 | checksum = "fcdc935b63408d58a32f8cc9738a0bffd8f05cc7c002086c6ef20b7312ad9dcd" 1387 | dependencies = [ 1388 | "bumpalo", 1389 | "log", 1390 | "once_cell", 1391 | "proc-macro2", 1392 | "quote", 1393 | "syn", 1394 | "wasm-bindgen-shared", 1395 | ] 1396 | 1397 | [[package]] 1398 | name = "wasm-bindgen-futures" 1399 | version = "0.4.40" 1400 | source = "registry+https://github.com/rust-lang/crates.io-index" 1401 | checksum = "bde2032aeb86bdfaecc8b261eef3cba735cc426c1f3a3416d1e0791be95fc461" 1402 | dependencies = [ 1403 | "cfg-if", 1404 | "js-sys", 1405 | "wasm-bindgen", 1406 | "web-sys", 1407 | ] 1408 | 1409 | [[package]] 1410 | name = "wasm-bindgen-macro" 1411 | version = "0.2.90" 1412 | source = "registry+https://github.com/rust-lang/crates.io-index" 1413 | checksum = "3e4c238561b2d428924c49815533a8b9121c664599558a5d9ec51f8a1740a999" 1414 | dependencies = [ 1415 | "quote", 1416 | "wasm-bindgen-macro-support", 1417 | ] 1418 | 1419 | [[package]] 1420 | name = "wasm-bindgen-macro-support" 1421 | version = "0.2.90" 1422 | source = "registry+https://github.com/rust-lang/crates.io-index" 1423 | checksum = "bae1abb6806dc1ad9e560ed242107c0f6c84335f1749dd4e8ddb012ebd5e25a7" 1424 | dependencies = [ 1425 | "proc-macro2", 1426 | "quote", 1427 | "syn", 1428 | "wasm-bindgen-backend", 1429 | "wasm-bindgen-shared", 1430 | ] 1431 | 1432 | [[package]] 1433 | name = "wasm-bindgen-shared" 1434 | version = "0.2.90" 1435 | source = "registry+https://github.com/rust-lang/crates.io-index" 1436 | checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b" 1437 | 1438 | [[package]] 1439 | name = "web-sys" 1440 | version = "0.3.67" 1441 | source = "registry+https://github.com/rust-lang/crates.io-index" 1442 | checksum = "58cd2333b6e0be7a39605f0e255892fd7418a682d8da8fe042fe25128794d2ed" 1443 | dependencies = [ 1444 | "js-sys", 1445 | "wasm-bindgen", 1446 | ] 1447 | 1448 | [[package]] 1449 | name = "windows-core" 1450 | version = "0.52.0" 1451 | source = "registry+https://github.com/rust-lang/crates.io-index" 1452 | checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" 1453 | dependencies = [ 1454 | "windows-targets 0.52.0", 1455 | ] 1456 | 1457 | [[package]] 1458 | name = "windows-sys" 1459 | version = "0.48.0" 1460 | source = "registry+https://github.com/rust-lang/crates.io-index" 1461 | checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" 1462 | dependencies = [ 1463 | "windows-targets 0.48.5", 1464 | ] 1465 | 1466 | [[package]] 1467 | name = "windows-sys" 1468 | version = "0.52.0" 1469 | source = "registry+https://github.com/rust-lang/crates.io-index" 1470 | checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" 1471 | dependencies = [ 1472 | "windows-targets 0.52.0", 1473 | ] 1474 | 1475 | [[package]] 1476 | name = "windows-targets" 1477 | version = "0.48.5" 1478 | source = "registry+https://github.com/rust-lang/crates.io-index" 1479 | checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" 1480 | dependencies = [ 1481 | "windows_aarch64_gnullvm 0.48.5", 1482 | "windows_aarch64_msvc 0.48.5", 1483 | "windows_i686_gnu 0.48.5", 1484 | "windows_i686_msvc 0.48.5", 1485 | "windows_x86_64_gnu 0.48.5", 1486 | "windows_x86_64_gnullvm 0.48.5", 1487 | "windows_x86_64_msvc 0.48.5", 1488 | ] 1489 | 1490 | [[package]] 1491 | name = "windows-targets" 1492 | version = "0.52.0" 1493 | source = "registry+https://github.com/rust-lang/crates.io-index" 1494 | checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" 1495 | dependencies = [ 1496 | "windows_aarch64_gnullvm 0.52.0", 1497 | "windows_aarch64_msvc 0.52.0", 1498 | "windows_i686_gnu 0.52.0", 1499 | "windows_i686_msvc 0.52.0", 1500 | "windows_x86_64_gnu 0.52.0", 1501 | "windows_x86_64_gnullvm 0.52.0", 1502 | "windows_x86_64_msvc 0.52.0", 1503 | ] 1504 | 1505 | [[package]] 1506 | name = "windows_aarch64_gnullvm" 1507 | version = "0.48.5" 1508 | source = "registry+https://github.com/rust-lang/crates.io-index" 1509 | checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" 1510 | 1511 | [[package]] 1512 | name = "windows_aarch64_gnullvm" 1513 | version = "0.52.0" 1514 | source = "registry+https://github.com/rust-lang/crates.io-index" 1515 | checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" 1516 | 1517 | [[package]] 1518 | name = "windows_aarch64_msvc" 1519 | version = "0.48.5" 1520 | source = "registry+https://github.com/rust-lang/crates.io-index" 1521 | checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" 1522 | 1523 | [[package]] 1524 | name = "windows_aarch64_msvc" 1525 | version = "0.52.0" 1526 | source = "registry+https://github.com/rust-lang/crates.io-index" 1527 | checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" 1528 | 1529 | [[package]] 1530 | name = "windows_i686_gnu" 1531 | version = "0.48.5" 1532 | source = "registry+https://github.com/rust-lang/crates.io-index" 1533 | checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" 1534 | 1535 | [[package]] 1536 | name = "windows_i686_gnu" 1537 | version = "0.52.0" 1538 | source = "registry+https://github.com/rust-lang/crates.io-index" 1539 | checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" 1540 | 1541 | [[package]] 1542 | name = "windows_i686_msvc" 1543 | version = "0.48.5" 1544 | source = "registry+https://github.com/rust-lang/crates.io-index" 1545 | checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" 1546 | 1547 | [[package]] 1548 | name = "windows_i686_msvc" 1549 | version = "0.52.0" 1550 | source = "registry+https://github.com/rust-lang/crates.io-index" 1551 | checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" 1552 | 1553 | [[package]] 1554 | name = "windows_x86_64_gnu" 1555 | version = "0.48.5" 1556 | source = "registry+https://github.com/rust-lang/crates.io-index" 1557 | checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" 1558 | 1559 | [[package]] 1560 | name = "windows_x86_64_gnu" 1561 | version = "0.52.0" 1562 | source = "registry+https://github.com/rust-lang/crates.io-index" 1563 | checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" 1564 | 1565 | [[package]] 1566 | name = "windows_x86_64_gnullvm" 1567 | version = "0.48.5" 1568 | source = "registry+https://github.com/rust-lang/crates.io-index" 1569 | checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" 1570 | 1571 | [[package]] 1572 | name = "windows_x86_64_gnullvm" 1573 | version = "0.52.0" 1574 | source = "registry+https://github.com/rust-lang/crates.io-index" 1575 | checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" 1576 | 1577 | [[package]] 1578 | name = "windows_x86_64_msvc" 1579 | version = "0.48.5" 1580 | source = "registry+https://github.com/rust-lang/crates.io-index" 1581 | checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" 1582 | 1583 | [[package]] 1584 | name = "windows_x86_64_msvc" 1585 | version = "0.52.0" 1586 | source = "registry+https://github.com/rust-lang/crates.io-index" 1587 | checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" 1588 | 1589 | [[package]] 1590 | name = "winreg" 1591 | version = "0.50.0" 1592 | source = "registry+https://github.com/rust-lang/crates.io-index" 1593 | checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" 1594 | dependencies = [ 1595 | "cfg-if", 1596 | "windows-sys 0.48.0", 1597 | ] 1598 | --------------------------------------------------------------------------------