Module beamlit.serve.middlewares
================================
Package: middlewares

This package contains custom middleware classes for the Beamlit server,
including access logging and process time header addition.

Sub-modules
-----------
* beamlit.serve.middlewares.accesslog
* beamlit.serve.middlewares.processtime

Classes
-------

`AccessLogMiddleware(app: ASGIApp, dispatch: DispatchFunction | None = None)`
:   Middleware for logging access information of each HTTP request.

    ### Ancestors (in MRO)

    * starlette.middleware.base.BaseHTTPMiddleware

    ### Methods

    `dispatch(self, request, call_next)`
    :   Processes each request to log access details.
        
        Args:
            request (Request): The incoming HTTP request.
            call_next (Callable): The next middleware or endpoint handler.
        
        Returns:
            Response: The HTTP response generated by the next handler.

`AddProcessTimeHeader(app: ASGIApp, dispatch: DispatchFunction | None = None)`
:   Middleware to add the X-Process-Time header to each HTTP response.

    ### Ancestors (in MRO)

    * starlette.middleware.base.BaseHTTPMiddleware

    ### Methods

    `dispatch(self, request, call_next)`
    :   Calculates and adds the processing time to the response headers.
        
        Args:
            request (Request): The incoming HTTP request.
            call_next (Callable): The next middleware or endpoint handler.
        
        Returns:
            Response: The HTTP response with the X-Process-Time header added.