pub struct HttpRequest {
pub url: String,
pub method: String,
pub headers: Vec<(String, String)>,
}Expand description
Description of an outgoing HTTP request.
Deliberately minimal: the engine only needs GET requests for tile fetching. Headers are optional and cover authentication or User-Agent overrides.
§Example
use rustial_engine::HttpRequest;
let req = HttpRequest::get("https://tile.openstreetmap.org/10/512/340.png");
assert_eq!(req.url, "https://tile.openstreetmap.org/10/512/340.png");
assert_eq!(req.method, "GET");Fields§
§url: StringThe URL to fetch.
method: StringHTTP method. Defaults to "GET" via HttpRequest::get.
The engine only uses GET, but the field is public so host applications can reuse this type for other verbs if needed.
headers: Vec<(String, String)>Optional request headers as (name, value) pairs.
Common uses: User-Agent, Authorization, Accept.
Implementations§
Trait Implementations§
Source§impl Clone for HttpRequest
impl Clone for HttpRequest
Auto Trait Implementations§
impl Freeze for HttpRequest
impl RefUnwindSafe for HttpRequest
impl Send for HttpRequest
impl Sync for HttpRequest
impl Unpin for HttpRequest
impl UnsafeUnpin for HttpRequest
impl UnwindSafe for HttpRequest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more