[−][src]Struct hreq::server::Server
Implementations
impl Server<()>
[src]
impl<State> Server<State> where
State: Clone + Unpin + Send + Sync + 'static,
[src]
State: Clone + Unpin + Send + Sync + 'static,
pub fn with_state(state: State) -> Self
[src]
Create a server over a provided state.
pub fn state(&self) -> State
[src]
pub fn at(&mut self, path: &str) -> Route<State>
[src]
pub async fn listen<'_>(
&'_ self,
port: u16
) -> Result<(ServerHandle, SocketAddr), Error>
[src]
&'_ self,
port: u16
) -> Result<(ServerHandle, SocketAddr), Error>
pub async fn listen_tls<'_>(
&'_ self,
port: u16,
tls: ServerConfig
) -> Result<(ServerHandle, SocketAddr), Error>
[src]
&'_ self,
port: u16,
tls: ServerConfig
) -> Result<(ServerHandle, SocketAddr), Error>
pub async fn handle<B: Into<Body>, '_>(
&'_ self,
req: Request<B>
) -> Result<Response<Body>, Error>
[src]
&'_ self,
req: Request<B>
) -> Result<Response<Body>, Error>
Trait Implementations
Auto Trait Implementations
impl<State> !RefUnwindSafe for Server<State>
impl<State> Send for Server<State> where
State: Send + Sync,
State: Send + Sync,
impl<State> Sync for Server<State> where
State: Send + Sync,
State: Send + Sync,
impl<State> Unpin for Server<State>
impl<State> !UnwindSafe for Server<State>
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,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Sealed<T> for T where
T: ?Sized,
T: ?Sized,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
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.
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.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> WithSubscriber for T
[src]
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
[src]
S: Into<Dispatch>,