pub struct HttpListener { /* private fields */ }
Expand description
A NetworkListener
for HttpStream
s.
Implementations§
Source§impl HttpListener
impl HttpListener
Sourcepub fn new<To>(addr: To) -> Result<HttpListener, Error>where
To: ToSocketAddrs,
pub fn new<To>(addr: To) -> Result<HttpListener, Error>where
To: ToSocketAddrs,
Start listening to an address over HTTP.
Trait Implementations§
Source§impl AsRawFd for HttpListener
impl AsRawFd for HttpListener
Source§impl Clone for HttpListener
impl Clone for HttpListener
Source§fn clone(&self) -> HttpListener
fn clone(&self) -> HttpListener
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl From<TcpListener> for HttpListener
impl From<TcpListener> for HttpListener
Source§fn from(listener: TcpListener) -> HttpListener
fn from(listener: TcpListener) -> HttpListener
Converts to this type from the input type.
Source§impl FromRawFd for HttpListener
impl FromRawFd for HttpListener
Source§unsafe fn from_raw_fd(fd: i32) -> HttpListener
unsafe fn from_raw_fd(fd: i32) -> HttpListener
Constructs a new instance of
Self
from the given raw file
descriptor. Read moreSource§impl NetworkListener for HttpListener
impl NetworkListener for HttpListener
Source§type Stream = HttpStream
type Stream = HttpStream
The stream produced for each connection.
Source§fn local_addr(&mut self) -> Result<SocketAddr, Error>
fn local_addr(&mut self) -> Result<SocketAddr, Error>
Get the address this Listener ended up listening on.
Source§fn set_read_timeout(&mut self, duration: Option<Duration>)
fn set_read_timeout(&mut self, duration: Option<Duration>)
Sets the read timeout for all streams that are accepted
Source§fn set_write_timeout(&mut self, duration: Option<Duration>)
fn set_write_timeout(&mut self, duration: Option<Duration>)
Sets the write timeout for all streams that are accepted
Source§fn incoming(&mut self) -> NetworkConnections<'_, Self> ⓘ
fn incoming(&mut self) -> NetworkConnections<'_, Self> ⓘ
Returns an iterator over incoming connections.
Auto Trait Implementations§
impl Freeze for HttpListener
impl RefUnwindSafe for HttpListener
impl Send for HttpListener
impl Sync for HttpListener
impl Unpin for HttpListener
impl UnwindSafe for HttpListener
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