liveBook · Manning

Awc

As explained in Rust Servers, Services, and Apps

awc is an asynchronous HTTP client library for Rust in the Actix Web ecosystem.

awc is the asynchronous HTTP client used by an Actix Web application to call a backend tutor service during registration. The handler submits a POST request after validating the registration form and receives the newly created tutor record, including its tutor ID. section 8.3

The registration workflow uses awc alongside application persistence:

  • Check that the password and confirmation match before making the request. section 8.3
  • Post the validated tutor data to the backend web service. section 8.3
  • Store the returned tutor ID with the username and password hash in PostgreSQL for later authentication and profile requests. section 8.3

Registration submission

A handler such as handle_register validates form data, calls the tutor service through awc, and uses the returned tutor ID when storing the local user record. section 8.3

sqlx = {version = "0.3.5", default_features = false, features =
["postgres","runtime-tokio", "macros"]}
rust-argon2 = "0.8.3"
awc = "2.0.3"

Inspect the dependency listing showing awc 2.0.3 alongside sqlx and rust-argon2. section 8.3

How Rust Servers, Services, and Apps covers it

How deep it goes
Demonstrates awc’s role in a POST workflow but does not detail client construction, request configuration, or response parsing.
Examples
Uses tutor registration, backend tutor creation, returned tutor IDs, and the awc 2.0.3 dependency.
What it assumes
Assumes familiarity with Rust, Actix Web handlers, form validation, asynchronous operations, and PostgreSQL-backed application state.
What you can do after
Apply it via an Actix Web handler to send registration data to a backend HTTP service.
How it connects
Connects asynchronous HTTP requests with Actix Web handlers, PostgreSQL persistence, and tutor-service registration.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Rust Servers, Services, and Apps. The section links point to the parts of the book it draws on.