pub struct Server { /* private fields */ }axum only.Expand description
§XML-RPC server implementation
This type provides a very simple XML-RPC server implementation based on axum::Router.
Implementations§
Source§impl Server
impl Server
Sourcepub const fn from_route(route: Router) -> Server
pub const fn from_route(route: Router) -> Server
This method can be used to construct a Server from a standalone axum::Router, which
will only handle requests at that one route.
Sourcepub fn shutdown_trigger(&mut self) -> Arc<Notify>
pub fn shutdown_trigger(&mut self) -> Arc<Notify>
This method adds a barrier / notifier to the server that will trigger graceful shutdown, and returns a reference to it, which can be used to trigger graceful server shutdown upon request.
Sourcepub async fn serve(self, addr: SocketAddr) -> Result<(), ServerError>
pub async fn serve(self, addr: SocketAddr) -> Result<(), ServerError>
This method launches a server that listens at the specified socket address with the configured route of the XML-RPC endpoint as the only route that will accept requests.
Requests with invalid input, calls of unknown methods, and failed methods are converted into fault responses.
Sourcepub async fn serve_listener<L>(self, listener: L) -> Result<(), ServerError>
pub async fn serve_listener<L>(self, listener: L) -> Result<(), ServerError>
This method launches a server that uses the supplied Listener and with the
configured route of the XML-RPC endpoint as the only route that will accept requests.
Requests with invalid input, calls of unknown methods, and failed methods are converted into fault responses.