Files
scryer-prolog/src/http.rs
Alexander McLin fcd6c3f127 Issue 3223: Second phase of migration to Rust Edition
Reformat via `cargo fmt`
2026-06-16 21:05:12 -04:00

26 lines
597 B
Rust

use bytes::{Bytes, buf::Reader};
use std::sync::{Arc, Condvar, Mutex};
use tokio::sync::Notify;
use warp::http;
pub struct HttpListener {
pub incoming: std::sync::mpsc::Receiver<HttpRequest>,
pub warp_shutdown: Arc<Notify>,
}
pub struct HttpRequest {
pub request_data: HttpRequestData,
pub response: HttpResponse,
}
pub type HttpResponse = Arc<(Mutex<bool>, Mutex<Option<warp::reply::Response>>, Condvar)>;
pub struct HttpRequestData {
pub method: http::Method,
pub headers: http::HeaderMap,
pub path: String,
pub query: String,
pub body: Reader<Bytes>,
}