Struct hyper_simple_server::ConfigurationBuilder
source · [−]pub struct ConfigurationBuilder { /* private fields */ }
Implementations
sourceimpl ConfigurationBuilder
impl ConfigurationBuilder
pub fn new() -> Self
pub fn build(self) -> ServerResult<Configuration>
sourceimpl ConfigurationBuilder
impl ConfigurationBuilder
pub fn with_endpoint(self, _endpoint: Endpoint) -> Self
pub fn with_endpoint_address(self, _address: EndpointAddress) -> Self
pub fn with_endpoint_socket_address(
self,
_address: impl Into<SocketAddr>
) -> Self
pub fn with_endpoint_socket_address_parse(
self,
_address: &impl ToSocketAddrs + ?Sized
) -> ServerResult<Self>
pub fn with_endpoint_descriptor(self, _descriptor: u32) -> Self
pub fn with_endpoint_protocol(self, _protocol: EndpointProtocol) -> Self
pub fn with_endpoint_security(self, _security: EndpointSecurity) -> Self
sourceimpl ConfigurationBuilder
impl ConfigurationBuilder
pub fn with_endpoint_certificate_rustls(
self,
_certificate: RustTlsCertificate
) -> Self
pub fn with_endpoint_certificate_rustls_from_pem_file(
self,
_path: impl AsRef<Path>
) -> ServerResult<Self>
pub fn with_endpoint_certificate_rustls_from_pem_data(
self,
_data: impl AsRef<[u8]>
) -> ServerResult<Self>
sourceimpl ConfigurationBuilder
impl ConfigurationBuilder
pub fn with_handler<H, F, RB>(self, _handler: H) -> Self where
H: Handler<Future = F, ResponseBody = RB, ResponseBodyError = RB::Error> + Send + Sync + 'static,
F: Future<Output = ServerResult<Response<RB>>> + Send + 'static,
RB: BodyTrait<Data = Bytes> + Send + Sync + 'static,
RB::Error: Error + Send + Sync + 'static,
pub fn with_handler_fn_sync<I, C, RB>(self, _handler: I) -> Self where
I: Into<HandlerFnSync<C, RB>>,
C: Fn(Request<Body>) -> ServerResult<Response<RB>> + Send + Sync + 'static,
RB: BodyTrait<Data = Bytes> + Send + Sync + 'static,
RB::Error: Error + Send + Sync + 'static,
pub fn with_handler_fn_async<I, C, F, RB>(self, _handler: I) -> Self where
I: Into<HandlerFnAsync<C, F, RB>>,
C: Fn(Request<Body>) -> F + Send + Sync + 'static,
F: Future<Output = ServerResult<Response<RB>>> + Send + 'static,
RB: BodyTrait<Data = Bytes> + Send + Sync + 'static,
RB::Error: Error + Send + Sync + 'static,
pub fn with_handler_dyn<H>(self, _handler: H) -> Self where
H: HandlerDyn,
pub fn with_handler_arc<I>(self, _handler: I) -> Self where
I: Into<HandlerDynArc>,
sourceimpl ConfigurationBuilder
impl ConfigurationBuilder
pub fn with_route<'a, P, H, F, RB>(self, _paths: P, _handler: H) -> Self where
P: Into<RoutePaths<'a>>,
H: Handler<Future = F, ResponseBody = RB, ResponseBodyError = RB::Error> + Send + Sync + 'static,
F: Future<Output = ServerResult<Response<RB>>> + Send + 'static,
RB: BodyTrait<Data = Bytes> + Send + Sync + 'static,
RB::Error: Error + Send + Sync + 'static,
pub fn with_route_fn_sync<'a, P, I, C, RB>(self, _paths: P, _handler: I) -> Self where
P: Into<RoutePaths<'a>>,
I: Into<HandlerFnSync<C, RB>>,
C: Fn(Request<Body>) -> ServerResult<Response<RB>> + Send + Sync + 'static,
RB: BodyTrait<Data = Bytes> + Send + Sync + 'static,
RB::Error: Error + Send + Sync + 'static,
pub fn with_route_fn_async<'a, P, I, C, F, RB>(
self,
_paths: P,
_handler: I
) -> Self where
P: Into<RoutePaths<'a>>,
I: Into<HandlerFnAsync<C, F, RB>>,
C: Fn(Request<Body>) -> F + Send + Sync + 'static,
F: Future<Output = ServerResult<Response<RB>>> + Send + 'static,
RB: BodyTrait<Data = Bytes> + Send + Sync + 'static,
RB::Error: Error + Send + Sync + 'static,
pub fn with_route_dyn<'a, P, H>(self, _paths: P, _handler: H) -> Self where
H: HandlerDyn,
P: Into<RoutePaths<'a>>,
pub fn with_route_arc<'a, P, I>(self, _paths: P, _handler: I) -> Self where
I: Into<HandlerDynArc>,
P: Into<RoutePaths<'a>>,
pub fn with_routes(self, _routes: impl Into<Routes>) -> Self
Auto Trait Implementations
impl !RefUnwindSafe for ConfigurationBuilder
impl Send for ConfigurationBuilder
impl Sync for ConfigurationBuilder
impl Unpin for ConfigurationBuilder
impl !UnwindSafe for ConfigurationBuilder
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more