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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)