Struct async_h1::server::Server [−][src]
struct for server
Implementations
impl<RW, F, Fut> Server<RW, F, Fut> where
RW: Read + Write + Clone + Send + Sync + Unpin + 'static,
F: Fn(Request) -> Fut,
Fut: Future<Output = Result<Response>>,
[src]
RW: Read + Write + Clone + Send + Sync + Unpin + 'static,
F: Fn(Request) -> Fut,
Fut: Future<Output = Result<Response>>,
pub fn new(io: RW, endpoint: F) -> Self
[src]
builds a new server
pub fn with_opts(self, opts: ServerOptions) -> Self
[src]
with opts
pub async fn accept(&mut self) -> Result<()>
[src]
accept in a loop
pub async fn accept_one(&mut self) -> Result<ConnectionStatus> where
RW: Read + Write + Clone + Send + Sync + Unpin + 'static,
F: Fn(Request) -> Fut,
Fut: Future<Output = Result<Response>>,
[src]
RW: Read + Write + Clone + Send + Sync + Unpin + 'static,
F: Fn(Request) -> Fut,
Fut: Future<Output = Result<Response>>,
accept one request
Trait Implementations
Auto Trait Implementations
impl<RW, F, Fut> RefUnwindSafe for Server<RW, F, Fut> where
F: RefUnwindSafe,
Fut: RefUnwindSafe,
RW: RefUnwindSafe,
F: RefUnwindSafe,
Fut: RefUnwindSafe,
RW: RefUnwindSafe,
impl<RW, F, Fut> Send for Server<RW, F, Fut> where
F: Send,
Fut: Send,
RW: Send,
F: Send,
Fut: Send,
RW: Send,
impl<RW, F, Fut> Sync for Server<RW, F, Fut> where
F: Sync,
Fut: Sync,
RW: Sync,
F: Sync,
Fut: Sync,
RW: Sync,
impl<RW, F, Fut> Unpin for Server<RW, F, Fut> where
F: Unpin,
Fut: Unpin,
RW: Unpin,
F: Unpin,
Fut: Unpin,
RW: Unpin,
impl<RW, F, Fut> UnwindSafe for Server<RW, F, Fut> where
F: UnwindSafe,
Fut: UnwindSafe,
RW: UnwindSafe,
F: UnwindSafe,
Fut: UnwindSafe,
RW: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,