Skip to content

Phase 2, Task 6: Migrate entry point from #[fastly::main] to raw main() #573

@aram356

Description

@aram356

Parent: #563
Phase: #567

Summary

Migrate main.rs from #[fastly::main] to an undecorated main() with Request::from_client(). Required because stream_to_client() / send_to_client() are incompatible with #[fastly::main]'s return-based model.

Changes

  • Replace #[fastly::main] fn main(req: Request) -> Result<Response, Error> with undecorated fn main()
  • Use Request::from_client() to get incoming request
  • Explicit error handling via to_error_response().send_to_client()
  • All non-streaming routes use resp.send_to_client()
  • No fastly::init() needed (doesn't exist in SDK 0.11.12)

File: crates/trusted-server-adapter-fastly/src/main.rs:32-68

Plan

See docs/superpowers/plans/2026-03-25-streaming-response.md — Task 6

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions