Struct uiuifree_actix_web_util::HttpServer
source · [−]pub struct HttpServer<F, I, S, B> where
F: 'static + Fn() -> I + Send + Clone,
I: IntoServiceFactory<S, Request<Pin<Box<dyn Stream<Item = Result<Bytes, PayloadError>> + 'static, Global>>>>,
S: ServiceFactory<Request<Pin<Box<dyn Stream<Item = Result<Bytes, PayloadError>> + 'static, Global>>>, Config = AppConfig>,
B: MessageBody,
<S as ServiceFactory<Request<Pin<Box<dyn Stream<Item = Result<Bytes, PayloadError>> + 'static, Global>>>>>::Error: Into<Error>,
<S as ServiceFactory<Request<Pin<Box<dyn Stream<Item = Result<Bytes, PayloadError>> + 'static, Global>>>>>::InitError: Debug,
<S as ServiceFactory<Request<Pin<Box<dyn Stream<Item = Result<Bytes, PayloadError>> + 'static, Global>>>>>::Response: Into<Response<B>>, { /* private fields */ }Expand description
An HTTP Server.
Create new HTTP server with application factory.
use actix_web::{web, App, HttpResponse, HttpServer};
#[actix_rt::main]
async fn main() -> std::io::Result<()> {
HttpServer::new(
|| App::new()
.service(web::resource("/").to(|| HttpResponse::Ok())))
.bind("127.0.0.1:59090")?
.run()
.await
}Implementations
sourceimpl<F, I, S, B> HttpServer<F, I, S, B> where
F: 'static + Fn() -> I + Send + Clone,
I: IntoServiceFactory<S, Request<Pin<Box<dyn Stream<Item = Result<Bytes, PayloadError>> + 'static, Global>>>>,
S: 'static + ServiceFactory<Request<Pin<Box<dyn Stream<Item = Result<Bytes, PayloadError>> + 'static, Global>>>, Config = AppConfig>,
B: 'static + MessageBody,
<S as ServiceFactory<Request<Pin<Box<dyn Stream<Item = Result<Bytes, PayloadError>> + 'static, Global>>>>>::Error: 'static,
<S as ServiceFactory<Request<Pin<Box<dyn Stream<Item = Result<Bytes, PayloadError>> + 'static, Global>>>>>::Error: Into<Error>,
<S as ServiceFactory<Request<Pin<Box<dyn Stream<Item = Result<Bytes, PayloadError>> + 'static, Global>>>>>::InitError: Debug,
<S as ServiceFactory<Request<Pin<Box<dyn Stream<Item = Result<Bytes, PayloadError>> + 'static, Global>>>>>::Response: 'static,
<S as ServiceFactory<Request<Pin<Box<dyn Stream<Item = Result<Bytes, PayloadError>> + 'static, Global>>>>>::Response: Into<Response<B>>,
<<S as ServiceFactory<Request<Pin<Box<dyn Stream<Item = Result<Bytes, PayloadError>> + 'static, Global>>>>>::Service as Service<Request<Pin<Box<dyn Stream<Item = Result<Bytes, PayloadError>> + 'static, Global>>>>>::Future: 'static,
<S as ServiceFactory<Request<Pin<Box<dyn Stream<Item = Result<Bytes, PayloadError>> + 'static, Global>>>>>::Service: 'static,
impl<F, I, S, B> HttpServer<F, I, S, B> where
F: 'static + Fn() -> I + Send + Clone,
I: IntoServiceFactory<S, Request<Pin<Box<dyn Stream<Item = Result<Bytes, PayloadError>> + 'static, Global>>>>,
S: 'static + ServiceFactory<Request<Pin<Box<dyn Stream<Item = Result<Bytes, PayloadError>> + 'static, Global>>>, Config = AppConfig>,
B: 'static + MessageBody,
<S as ServiceFactory<Request<Pin<Box<dyn Stream<Item = Result<Bytes, PayloadError>> + 'static, Global>>>>>::Error: 'static,
<S as ServiceFactory<Request<Pin<Box<dyn Stream<Item = Result<Bytes, PayloadError>> + 'static, Global>>>>>::Error: Into<Error>,
<S as ServiceFactory<Request<Pin<Box<dyn Stream<Item = Result<Bytes, PayloadError>> + 'static, Global>>>>>::InitError: Debug,
<S as ServiceFactory<Request<Pin<Box<dyn Stream<Item = Result<Bytes, PayloadError>> + 'static, Global>>>>>::Response: 'static,
<S as ServiceFactory<Request<Pin<Box<dyn Stream<Item = Result<Bytes, PayloadError>> + 'static, Global>>>>>::Response: Into<Response<B>>,
<<S as ServiceFactory<Request<Pin<Box<dyn Stream<Item = Result<Bytes, PayloadError>> + 'static, Global>>>>>::Service as Service<Request<Pin<Box<dyn Stream<Item = Result<Bytes, PayloadError>> + 'static, Global>>>>>::Future: 'static,
<S as ServiceFactory<Request<Pin<Box<dyn Stream<Item = Result<Bytes, PayloadError>> + 'static, Global>>>>>::Service: 'static,
sourcepub fn new(factory: F) -> HttpServer<F, I, S, B>
pub fn new(factory: F) -> HttpServer<F, I, S, B>
Create new HTTP server with application factory
sourcepub fn on_connect<CB>(self, f: CB) -> HttpServer<F, I, S, B> where
CB: 'static + Fn(&(dyn Any + 'static), &mut Extensions) + Send + Sync,
pub fn on_connect<CB>(self, f: CB) -> HttpServer<F, I, S, B> where
CB: 'static + Fn(&(dyn Any + 'static), &mut Extensions) + Send + Sync,
Sets function that will be called once before each connection is handled.
It will receive a &std::any::Any, which contains underlying connection type and an
Extensions container so that connection data can be accessed in middleware and handlers.
Connection Types
actix_tls::accept::openssl::TlsStream<actix_web::rt::net::TcpStream>when using openssl.actix_tls::accept::rustls::TlsStream<actix_web::rt::net::TcpStream>when using rustls.actix_web::rt::net::TcpStreamwhen no encryption is used.
See the on_connect example for additional details.
sourcepub fn workers(self, num: usize) -> HttpServer<F, I, S, B>
pub fn workers(self, num: usize) -> HttpServer<F, I, S, B>
Set number of workers to start.
By default, the number of available physical CPUs is used as the worker count.
sourcepub fn backlog(self, backlog: u32) -> HttpServer<F, I, S, B>
pub fn backlog(self, backlog: u32) -> HttpServer<F, I, S, B>
Set the maximum number of pending connections.
This refers to the number of clients that can be waiting to be served. Exceeding this number results in the client getting an error when attempting to connect. It should only affect servers under significant load.
Generally set in the 64-2048 range. Default value is 2048.
This method should be called before bind() method call.
sourcepub fn max_connections(self, num: usize) -> HttpServer<F, I, S, B>
pub fn max_connections(self, num: usize) -> HttpServer<F, I, S, B>
Sets the maximum per-worker number of concurrent connections.
All socket listeners will stop accepting connections when this limit is reached for each worker.
By default max connections is set to a 25k.
sourcepub fn max_connection_rate(self, num: usize) -> HttpServer<F, I, S, B>
pub fn max_connection_rate(self, num: usize) -> HttpServer<F, I, S, B>
Sets the maximum per-worker concurrent connection establish process.
All listeners will stop accepting connections when this limit is reached. It can be used to limit the global TLS CPU usage.
By default max connections is set to a 256.
sourcepub fn worker_max_blocking_threads(self, num: usize) -> HttpServer<F, I, S, B>
pub fn worker_max_blocking_threads(self, num: usize) -> HttpServer<F, I, S, B>
Set max number of threads for each worker’s blocking task thread pool.
One thread pool is set up per worker; not shared across workers.
By default set to 512 / workers.
sourcepub fn keep_alive<T>(self, val: T) -> HttpServer<F, I, S, B> where
T: Into<KeepAlive>,
pub fn keep_alive<T>(self, val: T) -> HttpServer<F, I, S, B> where
T: Into<KeepAlive>,
Set server keep-alive setting.
By default keep alive is set to a 5 seconds.
sourcepub fn client_request_timeout(self, dur: Duration) -> HttpServer<F, I, S, B>
pub fn client_request_timeout(self, dur: Duration) -> HttpServer<F, I, S, B>
Set server client timeout in milliseconds for first request.
Defines a timeout for reading client request header. If a client does not transmit the entire set headers within this time, the request is terminated with the 408 (Request Time-out) error.
To disable timeout set value to 0.
By default client timeout is set to 5000 milliseconds.
sourcepub fn client_disconnect_timeout(self, dur: Duration) -> HttpServer<F, I, S, B>
pub fn client_disconnect_timeout(self, dur: Duration) -> HttpServer<F, I, S, B>
Set server connection shutdown timeout in milliseconds.
Defines a timeout for shutdown connection. If a shutdown procedure does not complete within this time, the request is dropped.
To disable timeout set value to 0.
By default client timeout is set to 5000 milliseconds.
sourcepub fn server_hostname<T>(self, val: T) -> HttpServer<F, I, S, B> where
T: AsRef<str>,
pub fn server_hostname<T>(self, val: T) -> HttpServer<F, I, S, B> where
T: AsRef<str>,
Set server host name.
Host name is used by application router as a hostname for url generation. Check ConnectionInfo documentation for more information.
By default host name is set to a “localhost” value.
sourcepub fn system_exit(self) -> HttpServer<F, I, S, B>
pub fn system_exit(self) -> HttpServer<F, I, S, B>
Stop Actix System after server shutdown.
sourcepub fn disable_signals(self) -> HttpServer<F, I, S, B>
pub fn disable_signals(self) -> HttpServer<F, I, S, B>
Disable signal handling
sourcepub fn shutdown_timeout(self, sec: u64) -> HttpServer<F, I, S, B>
pub fn shutdown_timeout(self, sec: u64) -> HttpServer<F, I, S, B>
Timeout for graceful workers shutdown.
After receiving a stop signal, workers have this much time to finish serving requests. Workers still alive after the timeout are force dropped.
By default shutdown timeout sets to 30 seconds.
sourcepub fn addrs(&self) -> Vec<SocketAddr, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn addrs(&self) -> Vec<SocketAddr, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Get addresses of bound sockets.
sourcepub fn addrs_with_scheme(&self) -> Vec<(SocketAddr, &str), Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn addrs_with_scheme(&self) -> Vec<(SocketAddr, &str), Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Get addresses of bound sockets and the scheme for it.
This is useful when the server is bound from different sources with some sockets listening on HTTP and some listening on HTTPS and the user should be presented with an enumeration of which socket requires which protocol.
sourcepub fn listen(self, lst: TcpListener) -> Result<HttpServer<F, I, S, B>, Error>
pub fn listen(self, lst: TcpListener) -> Result<HttpServer<F, I, S, B>, Error>
Use listener for accepting incoming connection requests
HttpServer does not change any configuration for TcpListener, it needs to be configured before passing it to listen() method.
sourcepub fn bind<A>(self, addr: A) -> Result<HttpServer<F, I, S, B>, Error> where
A: ToSocketAddrs,
pub fn bind<A>(self, addr: A) -> Result<HttpServer<F, I, S, B>, Error> where
A: ToSocketAddrs,
The socket address to bind
To bind multiple addresses this method can be called multiple times.
sourcepub fn listen_uds(
self,
lst: UnixListener
) -> Result<HttpServer<F, I, S, B>, Error>
pub fn listen_uds(
self,
lst: UnixListener
) -> Result<HttpServer<F, I, S, B>, Error>
Start listening for unix domain (UDS) connections on existing listener.
sourceimpl<F, I, S, B> HttpServer<F, I, S, B> where
F: 'static + Fn() -> I + Send + Clone,
I: IntoServiceFactory<S, Request<Pin<Box<dyn Stream<Item = Result<Bytes, PayloadError>> + 'static, Global>>>>,
S: ServiceFactory<Request<Pin<Box<dyn Stream<Item = Result<Bytes, PayloadError>> + 'static, Global>>>, Config = AppConfig>,
B: MessageBody,
<S as ServiceFactory<Request<Pin<Box<dyn Stream<Item = Result<Bytes, PayloadError>> + 'static, Global>>>>>::Error: Into<Error>,
<S as ServiceFactory<Request<Pin<Box<dyn Stream<Item = Result<Bytes, PayloadError>> + 'static, Global>>>>>::InitError: Debug,
<S as ServiceFactory<Request<Pin<Box<dyn Stream<Item = Result<Bytes, PayloadError>> + 'static, Global>>>>>::Response: Into<Response<B>>,
<S as ServiceFactory<Request<Pin<Box<dyn Stream<Item = Result<Bytes, PayloadError>> + 'static, Global>>>>>::Service: 'static,
impl<F, I, S, B> HttpServer<F, I, S, B> where
F: 'static + Fn() -> I + Send + Clone,
I: IntoServiceFactory<S, Request<Pin<Box<dyn Stream<Item = Result<Bytes, PayloadError>> + 'static, Global>>>>,
S: ServiceFactory<Request<Pin<Box<dyn Stream<Item = Result<Bytes, PayloadError>> + 'static, Global>>>, Config = AppConfig>,
B: MessageBody,
<S as ServiceFactory<Request<Pin<Box<dyn Stream<Item = Result<Bytes, PayloadError>> + 'static, Global>>>>>::Error: Into<Error>,
<S as ServiceFactory<Request<Pin<Box<dyn Stream<Item = Result<Bytes, PayloadError>> + 'static, Global>>>>>::InitError: Debug,
<S as ServiceFactory<Request<Pin<Box<dyn Stream<Item = Result<Bytes, PayloadError>> + 'static, Global>>>>>::Response: Into<Response<B>>,
<S as ServiceFactory<Request<Pin<Box<dyn Stream<Item = Result<Bytes, PayloadError>> + 'static, Global>>>>>::Service: 'static,
sourcepub fn run(self) -> ServerⓘNotable traits for Serverimpl Future for Server type Output = Result<(), Error>;
pub fn run(self) -> ServerⓘNotable traits for Serverimpl Future for Server type Output = Result<(), Error>;
Start listening for incoming connections.
This method starts number of HTTP workers in separate threads.
For each address this method starts separate thread which does
accept() in a loop.
This methods panics if no socket address can be bound or an Actix system is not yet
configured.
use std::io;
use actix_web::{web, App, HttpResponse, HttpServer};
#[actix_rt::main]
async fn main() -> io::Result<()> {
HttpServer::new(|| App::new().service(web::resource("/").to(|| HttpResponse::Ok())))
.bind("127.0.0.1:0")?
.run()
.await
}Auto Trait Implementations
impl<F, I, S, B> !RefUnwindSafe for HttpServer<F, I, S, B>
impl<F, I, S, B> Send for HttpServer<F, I, S, B> where
B: Send,
S: Send,
impl<F, I, S, B> !Sync for HttpServer<F, I, S, B>
impl<F, I, S, B> Unpin for HttpServer<F, I, S, B> where
B: Unpin,
F: Unpin,
S: Unpin,
impl<F, I, S, B> !UnwindSafe for HttpServer<F, I, S, B>
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
impl<T> FmtForward for T
impl<T> FmtForward for T
fn fmt_binary(self) -> FmtBinary<Self> where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self> where
Self: Binary,
Causes self to use its Binary implementation when Debug-formatted.
fn fmt_display(self) -> FmtDisplay<Self> where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self> where
Self: Display,
Causes self to use its Display implementation when
Debug-formatted. Read more
fn fmt_lower_exp(self) -> FmtLowerExp<Self> where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self> where
Self: LowerExp,
Causes self to use its LowerExp implementation when
Debug-formatted. Read more
fn fmt_lower_hex(self) -> FmtLowerHex<Self> where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self> where
Self: LowerHex,
Causes self to use its LowerHex implementation when
Debug-formatted. Read more
fn fmt_octal(self) -> FmtOctal<Self> where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self> where
Self: Octal,
Causes self to use its Octal implementation when Debug-formatted.
fn fmt_pointer(self) -> FmtPointer<Self> where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self> where
Self: Pointer,
Causes self to use its Pointer implementation when
Debug-formatted. Read more
fn fmt_upper_exp(self) -> FmtUpperExp<Self> where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self> where
Self: UpperExp,
Causes self to use its UpperExp implementation when
Debug-formatted. Read more
fn fmt_upper_hex(self) -> FmtUpperHex<Self> where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self> where
Self: UpperHex,
Causes self to use its UpperHex implementation when
Debug-formatted. 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>
impl<T, U, I> LiftInto<U, I> for T where
U: LiftFrom<T, I>,
impl<T, U, I> LiftInto<U, I> for T where
U: LiftFrom<T, I>,
fn lift_into(self) -> U
fn lift_into(self) -> U
Performs the indexed conversion.
impl<T> Pipe for T where
T: ?Sized,
impl<T> Pipe for T where
T: ?Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
Pipes by value. This is generally the method you want to use. Read more
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R where
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R where
R: 'a,
Borrows self and passes that borrow into the pipe function. Read more
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R where
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R where
R: 'a,
Mutably borrows self and passes that borrow into the pipe function. Read more
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R where
Self: Borrow<B>,
B: 'a + ?Sized,
R: 'a,
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R where
Self: Borrow<B>,
B: 'a + ?Sized,
R: 'a,
Borrows self, then passes self.borrow() into the pipe function. Read more
fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R
) -> R where
Self: BorrowMut<B>,
B: 'a + ?Sized,
R: 'a,
fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R
) -> R where
Self: BorrowMut<B>,
B: 'a + ?Sized,
R: 'a,
Mutably borrows self, then passes self.borrow_mut() into the pipe
function. Read more
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R where
Self: AsRef<U>,
U: 'a + ?Sized,
R: 'a,
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R where
Self: AsRef<U>,
U: 'a + ?Sized,
R: 'a,
Borrows self, then passes self.as_ref() into the pipe function.
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R where
Self: AsMut<U>,
U: 'a + ?Sized,
R: 'a,
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R where
Self: AsMut<U>,
U: 'a + ?Sized,
R: 'a,
Mutably borrows self, then passes self.as_mut() into the pipe
function. Read more
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: Deref<Target = T>,
T: 'a + ?Sized,
R: 'a,
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: Deref<Target = T>,
T: 'a + ?Sized,
R: 'a,
Borrows self, then passes self.deref() into the pipe function.
impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Tap for T
impl<T> Tap for T
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self where
Self: Borrow<B>,
B: ?Sized,
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self where
Self: Borrow<B>,
B: ?Sized,
Immutable access to the Borrow<B> of a value. Read more
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self where
Self: BorrowMut<B>,
B: ?Sized,
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self where
Self: BorrowMut<B>,
B: ?Sized,
Mutable access to the BorrowMut<B> of a value. Read more
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self where
Self: AsRef<R>,
R: ?Sized,
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self where
Self: AsRef<R>,
R: ?Sized,
Immutable access to the AsRef<R> view of a value. Read more
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self where
Self: AsMut<R>,
R: ?Sized,
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self where
Self: AsMut<R>,
R: ?Sized,
Mutable access to the AsMut<R> view of a value. Read more
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self where
Self: Deref<Target = T>,
T: ?Sized,
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self where
Self: Deref<Target = T>,
T: ?Sized,
Immutable access to the Deref::Target of a value. Read more
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self where
Self: DerefMut<Target = T> + Deref,
T: ?Sized,
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self where
Self: DerefMut<Target = T> + Deref,
T: ?Sized,
Mutable access to the Deref::Target of a value. Read more
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
Calls .tap() only in debug builds, and is erased in release builds.
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
Calls .tap_mut() only in debug builds, and is erased in release
builds. Read more
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self where
Self: Borrow<B>,
B: ?Sized,
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self where
Self: Borrow<B>,
B: ?Sized,
Calls .tap_borrow() only in debug builds, and is erased in release
builds. Read more
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self where
Self: BorrowMut<B>,
B: ?Sized,
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self where
Self: BorrowMut<B>,
B: ?Sized,
Calls .tap_borrow_mut() only in debug builds, and is erased in release
builds. Read more
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self where
Self: AsRef<R>,
R: ?Sized,
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self where
Self: AsRef<R>,
R: ?Sized,
Calls .tap_ref() only in debug builds, and is erased in release
builds. Read more
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self where
Self: AsMut<R>,
R: ?Sized,
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self where
Self: AsMut<R>,
R: ?Sized,
Calls .tap_ref_mut() only in debug builds, and is erased in release
builds. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
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