messages list | category string | crate string | source dict |
|---|---|---|---|
[
{
"role": "system",
"content": "You are an expert Rust programmer specializing in the axum crate and modern Rust development patterns."
},
{
"role": "user",
"content": "How do I validate form data in an axum handler and return appropriate error responses when validation fails?"
},
{
"rol... | code_generation | axum | {
"type": "function_item",
"name": "test_no_param",
"source_file": "examples/validator/src/main.rs",
"pattern": null
} |
[
{
"role": "system",
"content": "You are an expert Rust programmer specializing in the axum crate and modern Rust development patterns."
},
{
"role": "user",
"content": "How do I create a custom extractor that transforms extraction errors into application-specific errors? I want the extractor to ... | api_usage | axum | {
"type": "function_item",
"name": "handler",
"source_file": "examples/customize-extractor-error/src/with_rejection.rs",
"pattern": null
} |
[
{
"role": "system",
"content": "You are an expert Rust programmer specializing in the axum crate and modern Rust development patterns."
},
{
"role": "user",
"content": "Explain how multipart form extraction works in axum when handling file uploads. What does the Multipart extractor do, and how d... | code_explanation | axum | {
"type": "impl_item",
"name": "MultipartError",
"source_file": "axum/src/extract/multipart.rs",
"pattern": null
} |
[
{
"role": "system",
"content": "You are an expert Rust programmer specializing in the axum crate and modern Rust development patterns."
},
{
"role": "user",
"content": "What happens if you put a body extractor like Form before a path parameter extractor in the handler signature? Show the bug and... | bug_detection | axum | {
"type": "function_item",
"name": "from_request",
"source_file": "axum-extra/src/extract/form.rs",
"pattern": null
} |
[
{
"role": "system",
"content": "You are an expert Rust programmer specializing in the axum crate and modern Rust development patterns."
},
{
"role": "user",
"content": "Review this axum code from axum-extra/src/extract/multipart.rs and identify potential bugs or issues:\n\n```rust\nasync fn body... | bug_detection | axum | {
"type": "function_item",
"name": "body_too_large",
"source_file": "axum-extra/src/extract/multipart.rs",
"pattern": null
} |
[
{
"role": "system",
"content": "You are an expert Rust programmer specializing in the axum crate and modern Rust development patterns."
},
{
"role": "user",
"content": "How do I build an axum application that uses app state to share configuration and services across multiple route handlers?"
}... | api_usage | axum | {
"type": "function_item",
"name": "main",
"source_file": "examples/oauth/src/main.rs",
"pattern": null
} |
[
{
"role": "system",
"content": "You are an expert Rust programmer specializing in the axum crate and modern Rust development patterns."
},
{
"role": "user",
"content": "Build a router that merges two sub-routers: one for user operations (GET, POST on /users) and another for admin operations (GET... | code_generation | axum | {
"type": "impl_item",
"name": "Clone",
"source_file": "axum/src/routing/mod.rs",
"pattern": null
} |
[
{
"role": "system",
"content": "You are an expert Rust programmer specializing in the axum crate and modern Rust development patterns."
},
{
"role": "user",
"content": "How does axum's `IntoResponse` trait enable composing HTTP responses from tuples of status codes, headers, and bodies?"
},
... | code_explanation | axum | {
"type": "function_item",
"name": "status_code_tuple_doesnt_override_error",
"source_file": "axum/src/response/mod.rs",
"pattern": null
} |
[
{
"role": "system",
"content": "You are an expert Rust programmer specializing in the axum crate and modern Rust development patterns."
},
{
"role": "user",
"content": "I'm building an HTTP header merger for method routing. What bug could occur when merging Allow headers? Show the buggy code and... | bug_detection | axum | {
"type": "impl_item",
"name": "AllowHeader",
"source_file": "axum/src/routing/method_routing.rs",
"pattern": null
} |
[
{
"role": "system",
"content": "You are an expert Rust programmer specializing in the axum crate and modern Rust development patterns."
},
{
"role": "user",
"content": "How do I extract path parameters in an axum handler and test that the extraction works correctly? Provide a complete test with ... | test_generation | axum | {
"type": "function_item",
"name": "deserialize",
"source_file": "axum/src/extract/path/mod.rs",
"pattern": null
} |
[
{
"role": "system",
"content": "You are an expert Rust programmer specializing in the axum crate and modern Rust development patterns."
},
{
"role": "user",
"content": "How do I structure responses with different status codes and payloads in Axum? Show me examples of tuple-based responses with S... | code_explanation | axum | {
"type": "function_item",
"name": "handler",
"source_file": "axum/src/response/mod.rs",
"pattern": null
} |
[
{
"role": "system",
"content": "You are an expert Rust programmer specializing in the axum crate and modern Rust development patterns."
},
{
"role": "user",
"content": "Build a webhook receiver endpoint that accepts POST requests with a JSON body containing event data and returns a 202 Accepted ... | code_generation | axum | {
"type": "function_item",
"name": "handler",
"source_file": "axum/src/extract/json.rs",
"pattern": null
} |
[
{
"role": "system",
"content": "You are an expert Rust programmer specializing in the axum crate and modern Rust development patterns."
},
{
"role": "user",
"content": "Refactor this messy handler setup to use fallback routing and cleaner state management. BEFORE: Multiple routes defined inline ... | refactoring | axum | {
"type": "function_item",
"name": "main",
"source_file": "examples/chat/src/main.rs",
"pattern": null
} |
[
{
"role": "system",
"content": "You are an expert Rust programmer specializing in the axum crate and modern Rust development patterns."
},
{
"role": "user",
"content": "How do I build a basic axum Router and convert it to a service for serving HTTP requests?"
},
{
"role": "assistant",
... | api_usage | axum | {
"type": "function_item",
"name": "main",
"source_file": "examples/tls-graceful-shutdown/src/main.rs",
"pattern": null
} |
[
{
"role": "system",
"content": "You are an expert Rust programmer specializing in the axum crate and modern Rust development patterns."
},
{
"role": "user",
"content": "How does axum build and manage the Allow header when multiple HTTP methods are registered on the same route? Explain how `Route... | code_explanation | axum | {
"type": "function_item",
"name": "append_allow_header",
"source_file": "axum/src/routing/method_routing.rs",
"pattern": null
} |
[
{
"role": "system",
"content": "You are an expert Rust programmer specializing in the axum crate and modern Rust development patterns."
},
{
"role": "user",
"content": "Create an axum API with separate admin and public routes. Admin routes should delete data while public routes fetch it. Use Sta... | code_generation | axum | {
"type": "function_item",
"name": "admin_routes",
"source_file": "examples/key-value-store/src/main.rs",
"pattern": null
} |
[
{
"role": "system",
"content": "You are an expert Rust developer specializing in Axum web framework refactoring. Improve code organization, error handling, and API usage."
},
{
"role": "user",
"content": "Refactor this messy Axum application setup code:\n\n```rust\nlet state_obj = Arc::new(AppSt... | refactoring | axum | {
"type": "unknown",
"name": "",
"source_file": "examples/chat/src/main.rs",
"pattern": null
} |
[
{
"role": "system",
"content": "You are an expert Rust programmer specializing in the axum crate and modern Rust development patterns."
},
{
"role": "user",
"content": "How do I deserialize JSON request bodies into strongly-typed structs with axum?"
},
{
"role": "assistant",
"content... | api_usage | axum | {
"type": "struct_item",
"name": "User",
"source_file": "examples/diesel-postgres/src/main.rs",
"pattern": null
} |
[
{
"role": "system",
"content": "You are an expert Rust programmer specializing in the axum crate and modern Rust development patterns."
},
{
"role": "user",
"content": "I have authentication and logging middleware duplicated across several routes. How do I refactor this into a reusable layer?"
... | refactoring | axum | {
"type": "function_item",
"name": "middleware",
"source_file": "axum/src/middleware/map_request.rs",
"pattern": null
} |
[
{
"role": "system",
"content": "You are an expert Rust developer familiar with the Axum web framework. Provide clear, working code examples using only verified Axum APIs."
},
{
"role": "user",
"content": "I need to build middleware that validates a request header and short-circuits the request (... | code_generation | axum | {
"type": "function_item",
"name": "works_for_short_circutting",
"source_file": "axum/src/middleware/map_request.rs",
"pattern": null
} |
[
{
"role": "system",
"content": "You are an expert Rust programmer specializing in the axum crate and modern Rust development patterns."
},
{
"role": "user",
"content": "Write an axum handler that processes POST requests with JSON bodies. The handler should accept a JSON payload containing 'name'... | code_generation | axum | {
"type": "impl_item",
"name": "ResponseFuture",
"source_file": "axum/src/middleware/map_request.rs",
"pattern": null
} |
[
{
"role": "system",
"content": "You are a Rust web development expert specializing in Axum framework patterns. Generate complete, working code examples with all necessary imports. Focus on practical, real-world usage."
},
{
"role": "user",
"content": "How do I create a custom JSON extractor for ... | api_usage | axum | {
"type": "unknown",
"name": "",
"source_file": "examples/error-handling/src/main.rs",
"pattern": null
} |
[
{
"role": "system",
"content": "You are an expert Rust programmer specializing in the axum crate and modern Rust development patterns."
},
{
"role": "user",
"content": "How do I handle cases where different response types depend on runtime conditions in axum? For example, I need to return either... | api_usage | axum | {
"type": "function_item",
"name": "impl_trait_both",
"source_file": "axum/src/response/mod.rs",
"pattern": null
} |
[
{
"role": "system",
"content": "You are an expert Rust programmer specializing in the axum crate and modern Rust development patterns."
},
{
"role": "user",
"content": "How do I implement JWT authentication middleware in Axum that validates tokens from Authorization headers and passes the user I... | code_generation | axum | {
"type": "function_item",
"name": "middleware",
"source_file": "examples/jwt/src/main.rs",
"pattern": null
} |
[
{
"role": "system",
"content": "You are an expert Rust programmer specializing in the axum crate and modern Rust development patterns."
},
{
"role": "user",
"content": "Write an axum handler that converts database errors into proper HTTP responses. Implement a function that transforms any error ... | code_generation | axum | {
"type": "function_item",
"name": "internal_error",
"source_file": "examples/tokio-postgres/src/main.rs",
"pattern": null
} |
[
{
"role": "system",
"content": "You are an expert Rust programmer specializing in the axum crate and modern Rust development patterns."
},
{
"role": "user",
"content": "How do I build a REST API endpoint that accepts JSON, returns JSON with a status code, and logs the client IP?"
},
{
"r... | code_generation | axum | {
"type": "function_item",
"name": "custom_listener_with_connect",
"source_file": "axum/src/extract/connect_info.rs",
"pattern": null
} |
[
{
"role": "system",
"content": "You are an expert Rust programmer specializing in the axum crate and modern Rust development patterns."
},
{
"role": "user",
"content": "How do I test a Router with a fallback handler to verify it returns a custom 404 response?"
},
{
"role": "assistant",
... | test_generation | axum | {
"type": "function_item",
"name": "test",
"source_file": "axum/src/routing/mod.rs",
"pattern": null
} |
[
{
"role": "system",
"content": "You are an expert Rust programmer specializing in the axum crate and modern Rust development patterns."
},
{
"role": "user",
"content": "How do I apply a middleware layer to an axum router that has state? I need to wrap my router with a custom layer that has acces... | code_generation | axum | {
"type": "function_item",
"name": "layer",
"source_file": "axum/src/middleware/from_extractor.rs",
"pattern": null
} |
[
{
"role": "system",
"content": "You are an expert Rust programmer specializing in the axum crate and modern Rust development patterns."
},
{
"role": "user",
"content": "How do I initialize a custom response type with default state? Write a complete handler that returns a custom response struct w... | code_generation | axum | {
"type": "function_item",
"name": "default",
"source_file": "axum/src/response/sse.rs",
"pattern": null
} |
[
{
"role": "system",
"content": "You are an expert Rust programmer specializing in the axum crate and modern Rust development patterns."
},
{
"role": "user",
"content": "I have a handler that manually escapes special characters in strings with nested loops. How can I refactor this to be cleaner a... | refactoring | axum | {
"type": "function_item",
"name": "fmt",
"source_file": "axum-extra/src/response/content_disposition.rs",
"pattern": null
} |
[
{
"role": "system",
"content": "You are an expert Rust programmer specializing in the axum crate and modern Rust development patterns."
},
{
"role": "user",
"content": "Refactor this messy axum handler that duplicates cookie jar initialization. Improve it using state extraction.\n\nBefore:\n```r... | refactoring | axum | {
"type": "function_item",
"name": "clone",
"source_file": "axum-extra/src/extract/cookie/private.rs",
"pattern": null
} |
[
{
"role": "system",
"content": "You are an expert Rust programmer specializing in the axum crate and modern Rust development patterns."
},
{
"role": "user",
"content": "How do I return formatted JSON responses from an axum handler?"
},
{
"role": "assistant",
"content": "Return a tupl... | api_usage | axum | {
"type": "function_item",
"name": "pretty",
"source_file": "axum-extra/src/response/erased_json.rs",
"pattern": null
} |
[
{
"role": "system",
"content": "You are an expert Rust programmer specializing in the axum crate and modern Rust development patterns."
},
{
"role": "user",
"content": "How do I write unit tests for axum POST handlers that use typed path extraction?"
},
{
"role": "assistant",
"conten... | test_generation | axum | {
"type": "function_item",
"name": "typed_post",
"source_file": "axum-extra/src/routing/mod.rs",
"pattern": null
} |
[
{
"role": "system",
"content": "You are an expert Rust programmer specializing in the axum crate and modern Rust development patterns."
},
{
"role": "user",
"content": "Write tests for the Query<T> extractor. Test valid parameters, missing parameters, and malformed data."
},
{
"role": "a... | test_generation | axum | {
"type": "function_item",
"name": "test",
"source_file": "axum/src/extract/query.rs",
"pattern": null
} |
[
{
"role": "system",
"content": "You are an expert Rust programmer specializing in the axum crate and modern Rust development patterns."
},
{
"role": "user",
"content": "Explain how axum extractors work by showing how to convert a custom rejection error. In the code shown, `JsonRejection` is bein... | code_explanation | axum | {
"type": "function_item",
"name": "from",
"source_file": "examples/customize-extractor-error/src/derive_from_request.rs",
"pattern": null
} |
[
{
"role": "system",
"content": "You are an expert Rust programmer specializing in the axum crate and modern Rust development patterns."
},
{
"role": "user",
"content": "I need to create a custom extractor in axum that validates JSON input and returns a custom error response. The extractor should... | api_usage | axum | {
"type": "function_item",
"name": "users_create",
"source_file": "examples/error-handling/src/main.rs",
"pattern": null
} |
[
{
"role": "system",
"content": "You are an expert Rust programmer specializing in the axum crate and modern Rust development patterns."
},
{
"role": "user",
"content": "I have a handler that returns a custom error type. The compiler says the error doesn't implement IntoResponse. What's the fix?"... | bug_detection | axum | {
"type": "function_item",
"name": "handler",
"source_file": "examples/error-handling/src/main.rs",
"pattern": null
} |
[
{
"role": "system",
"content": "You are an expert Rust programmer specializing in the axum crate and modern Rust development patterns."
},
{
"role": "user",
"content": "Refactor this verbose multipart chunk handler that doesn't use axum's Multipart extractor properly.\n\nBefore:\n```rust\nuse ax... | refactoring | axum | {
"type": "function_item",
"name": "chunk",
"source_file": "axum/src/extract/multipart.rs",
"pattern": null
} |
[
{
"role": "system",
"content": "You are an expert Rust programmer specializing in the axum crate and modern Rust development patterns."
},
{
"role": "user",
"content": "I'm building a WebSocket handler in axum. What are common mistakes when handling the upgrade?"
},
{
"role": "assistant"... | bug_detection | axum | {
"type": "function_item",
"name": "on_upgrade",
"source_file": "axum/src/extract/ws.rs",
"pattern": null
} |
[
{
"role": "system",
"content": "You are an expert Rust programmer specializing in the axum crate and modern Rust development patterns."
},
{
"role": "user",
"content": "How do I convert custom errors to axum responses? I want to return different HTTP status codes based on error type."
},
{
... | api_usage | axum | {
"type": "impl_item",
"name": "AppError",
"source_file": "examples/oauth/src/main.rs",
"pattern": null
} |
[
{
"role": "system",
"content": "You are an expert Rust programmer specializing in the axum crate and modern Rust development patterns."
},
{
"role": "user",
"content": "I have a Router with duplicate route paths that causes a panic. How do I fix this?"
},
{
"role": "assistant",
"cont... | bug_detection | axum | {
"type": "function_item",
"name": "main",
"source_file": "axum/src/routing/mod.rs",
"pattern": null
} |
[
{
"role": "system",
"content": "You are an expert Rust programmer specializing in the axum crate and modern Rust development patterns."
},
{
"role": "user",
"content": "How do I build a reverse proxy in Axum that forwards requests to backend services? Show me how to use State to manage backend U... | code_generation | axum | {
"type": "function_item",
"name": "main",
"source_file": "examples/reverse-proxy/src/main.rs",
"pattern": null
} |
[
{
"role": "system",
"content": "You are an expert Rust programmer specializing in the axum crate and modern Rust development patterns."
},
{
"role": "user",
"content": "How does axum handle invalid JSON in request bodies using extractors? Show how to create a handler that gracefully processes ma... | code_explanation | axum | {
"type": "function_item",
"name": "invalid_json_syntax",
"source_file": "axum-extra/src/extract/json_deserializer.rs",
"pattern": null
} |
[
{
"role": "system",
"content": "You are an expert Rust programmer specializing in the axum crate and modern Rust development patterns."
},
{
"role": "user",
"content": "I need to build a RESTful resource router for a blog system. Create routes for listing posts (GET /posts), creating a new post ... | code_generation | axum | {
"type": "function_item",
"name": "new",
"source_file": "axum-extra/src/routing/resource.rs",
"pattern": null
} |
[
{
"role": "system",
"content": "You are an expert Rust programmer specializing in the axum crate and modern Rust development patterns."
},
{
"role": "user",
"content": "I'm building a REST API and want to extract path parameters like user IDs from URLs. How should I use the Path extractor correc... | api_usage | axum | {
"type": "function_item",
"name": "from_request_parts",
"source_file": "axum/src/extract/path/mod.rs",
"pattern": null
} |
[
{
"role": "system",
"content": "You are an expert Rust programmer specializing in the axum crate and modern Rust development patterns."
},
{
"role": "user",
"content": "How does this custom FromRequestParts implementation work in axum? What axum traits and types are involved?\n\n```rust\nimpl<S>... | code_explanation | axum | {
"type": "impl_item",
"name": "DatabaseConnection",
"source_file": "examples/diesel-async-postgres/src/main.rs",
"pattern": null
} |
[
{
"role": "system",
"content": "You are an expert Rust programmer specializing in the axum crate and modern Rust development patterns."
},
{
"role": "user",
"content": "I have a handler that deserializes JSON input and returns either the parsed data or an error response. The current code uses ma... | refactoring | axum | {
"type": "function_item",
"name": "handler",
"source_file": "axum-extra/src/extract/json_deserializer.rs",
"pattern": null
} |
[
{
"role": "system",
"content": "You are an expert Rust programmer specializing in the axum crate and modern Rust development patterns."
},
{
"role": "user",
"content": "I want to refactor my axum routes to be more maintainable and use proper middleware patterns. Here's my current messy setup—how... | refactoring | axum | {
"type": "impl_item",
"name": "Clone",
"source_file": "axum/src/middleware/from_extractor.rs",
"pattern": null
} |
[
{
"role": "system",
"content": "You are an expert Rust programmer specializing in the axum crate and modern Rust development patterns."
},
{
"role": "user",
"content": "Refactor this MongoDB read handler to use proper error handling with custom rejection types. The current version uses a basic R... | refactoring | axum | {
"type": "function_item",
"name": "read_member",
"source_file": "examples/mongodb/src/main.rs",
"pattern": null
} |
[
{
"role": "system",
"content": "You are an expert Rust programmer specializing in the axum crate and modern Rust development patterns."
},
{
"role": "user",
"content": "How do I build a nested router in axum that accumulates URL path segments across multiple router levels?"
},
{
"role": ... | code_generation | axum | {
"type": "function_item",
"name": "call",
"source_file": "axum/src/extract/nested_path.rs",
"pattern": null
} |
[
{
"role": "system",
"content": "You are an expert Rust programmer specializing in the axum crate and modern Rust development patterns."
},
{
"role": "user",
"content": "Refactor this messier axum code to use better routing organization. The original code has route definitions scattered and could... | refactoring | axum | {
"type": "function_item",
"name": "post_foo",
"source_file": "examples/routes-and-handlers-close-together/src/main.rs",
"pattern": null
} |
[
{
"role": "system",
"content": "You are an expert Rust programmer specializing in the axum crate and modern Rust development patterns."
},
{
"role": "user",
"content": "Write an axum handler that accepts JSON input, returns it as a JSON response with a 200 status code, and properly handles conte... | code_generation | axum | {
"type": "function_item",
"name": "compress_br",
"source_file": "examples/compression/src/tests.rs",
"pattern": null
} |
[
{
"role": "system",
"content": "You are an expert Rust programmer specializing in the axum crate and modern Rust development patterns."
},
{
"role": "user",
"content": "How do I build a pagination system in axum using Query parameters and return typed responses?"
},
{
"role": "assistant"... | code_generation | axum | {
"type": "function_item",
"name": "handler",
"source_file": "axum/src/extract/query.rs",
"pattern": null
} |
[
{
"role": "system",
"content": "You are an expert Rust programmer specializing in the axum crate and modern Rust development patterns."
},
{
"role": "user",
"content": "I wrote a handler that extracts Query parameters first, then JSON body. Why doesn't it compile?"
},
{
"role": "assistan... | bug_detection | axum | {
"type": "impl_item",
"name": "Stream",
"source_file": "axum/src/response/sse.rs",
"pattern": null
} |
[
{
"role": "system",
"content": "You are an expert Rust programmer specializing in the axum crate and modern Rust development patterns."
},
{
"role": "user",
"content": "How do I handle form submissions in axum? I want to receive form data from an HTML form and process it."
},
{
"role": "... | api_usage | axum | {
"type": "function_item",
"name": "handler",
"source_file": "axum/src/extract/form.rs",
"pattern": null
} |
[
{
"role": "system",
"content": "You are an expert Rust programmer specializing in the axum crate and modern Rust development patterns."
},
{
"role": "user",
"content": "How do I set up routing with different methods (GET, POST) on the same path in Axum? I want to handle both GET and POST request... | api_usage | axum | {
"type": "function_item",
"name": "call_with_state",
"source_file": "axum/src/routing/mod.rs",
"pattern": null
} |
[
{
"role": "system",
"content": "You are an expert Rust programmer specializing in the axum crate and modern Rust development patterns."
},
{
"role": "user",
"content": "Build a rate limiter middleware that tracks requests per IP address using State in axum."
},
{
"role": "assistant",
... | code_generation | axum | {
"type": "function_item",
"name": "middleware",
"source_file": "axum/src/middleware/map_request.rs",
"pattern": null
} |
[
{
"role": "system",
"content": "You are an expert Rust programmer specializing in the axum crate and modern Rust development patterns."
},
{
"role": "user",
"content": "Refactor this axum routing code to use Path extractors with type-safe route parameters instead of raw string matching:"
},
... | refactoring | axum | {
"type": "trait_item",
"name": "TypedPath",
"source_file": "axum-extra/src/routing/typed.rs",
"pattern": null
} |
[
{
"role": "system",
"content": "You are an expert Rust programmer specializing in the axum crate and modern Rust development patterns."
},
{
"role": "user",
"content": "Show me a buggy implementation of a custom response type that implements IntoResponse incorrectly. What's the bug and how shoul... | bug_detection | axum | {
"type": "impl_item",
"name": "IntoResponse",
"source_file": "axum/src/response/mod.rs",
"pattern": null
} |
[
{
"role": "system",
"content": "You are an expert Rust programmer specializing in the axum crate and modern Rust development patterns."
},
{
"role": "user",
"content": "What's a better way to merge multiple axum Routers instead of manually chaining routes?"
},
{
"role": "assistant",
... | refactoring | axum | {
"type": "function_item",
"name": "as_service",
"source_file": "axum/src/routing/mod.rs",
"pattern": null
} |
[
{
"role": "system",
"content": "You are an expert Rust programmer specializing in the axum crate and modern Rust development patterns."
},
{
"role": "user",
"content": "I'm implementing a router with layering in axum. What's a common bug when applying middleware layers, and how do I fix it? Show... | bug_detection | axum | {
"type": "impl_item",
"name": "InfallibleRouteFuture",
"source_file": "axum/src/routing/route.rs",
"pattern": null
} |
[
{
"role": "system",
"content": "You are an expert Rust programmer specializing in the axum web framework. Provide complete, working code examples with all necessary imports."
},
{
"role": "user",
"content": "How do I extract the client's IP address (SocketAddr) from incoming requests in an axum ... | code_generation | axum | {
"type": "code_example",
"name": null,
"source_file": "axum/src/extract/connect_info.rs",
"pattern": "client address extraction with ConnectInfo"
} |
[
{
"role": "system",
"content": "You are an expert Rust programmer specializing in the axum crate and modern Rust development patterns."
},
{
"role": "user",
"content": "Create a subtly buggy version of an axum handler with WebSocket upgrade. The bug must involve a real API misuse pattern. Then p... | bug_detection | axum | {
"type": "function_item",
"name": "on_failed_upgrade",
"source_file": "axum/src/extract/ws.rs",
"pattern": null
} |
[
{
"role": "system",
"content": "You are an expert Rust programmer specializing in the axum crate and modern Rust development patterns."
},
{
"role": "user",
"content": "Explain how axum's middleware system works for modifying requests and responses. How do you layer middleware onto a router, and... | code_explanation | axum | {
"type": "function_item",
"name": "main",
"source_file": "examples/request-id/src/main.rs",
"pattern": null
} |
[
{
"role": "system",
"content": "You are an expert Rust programmer specializing in the axum crate and modern Rust development patterns."
},
{
"role": "user",
"content": "How would I implement a handler that formats and returns user claims as plain text? I need to create a Display-style format and... | code_generation | axum | {
"type": "impl_item",
"name": "Display",
"source_file": "examples/jwt/src/main.rs",
"pattern": null
} |
[
{
"role": "system",
"content": "You are an expert Rust programmer specializing in the axum crate and modern Rust development patterns."
},
{
"role": "user",
"content": "How do I return HTML responses with dynamic data in axum? Can you show a complete example using State to access shared data?"
... | api_usage | axum | {
"type": "function_item",
"name": "handler_content",
"source_file": "examples/templates-minijinja/src/main.rs",
"pattern": null
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.