Struct http_client::HttpClient
source · pub struct HttpClient<'a> { /* private fields */ }
Implementations§
source§impl<'a> HttpClient<'a>
impl<'a> HttpClient<'a>
sourcepub fn new(
interface: &'a Arc<NetworkInterface>,
local_port: u16,
remote_endpoint: IpEndpoint
) -> Result<Self, &'static str>
pub fn new( interface: &'a Arc<NetworkInterface>, local_port: u16, remote_endpoint: IpEndpoint ) -> Result<Self, &'static str>
Creates a new HTTP client connected to the given remote endpoint.
sourcepub fn send(
&mut self,
request: HttpRequest,
timeout: Option<Duration>
) -> Result<HttpResponse, &'static str>
pub fn send( &mut self, request: HttpRequest, timeout: Option<Duration> ) -> Result<HttpResponse, &'static str>
Sends an HTTP request with an optional timeout.
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for HttpClient<'a>
impl<'a> Send for HttpClient<'a>
impl<'a> Sync for HttpClient<'a>
impl<'a> Unpin for HttpClient<'a>
impl<'a> !UnwindSafe for HttpClient<'a>
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