leptos-server-fn

Creates and debugs Leptos #[server] functions with proper encoding and Send bounds.

Updated May 26, 2026
One-click install
npx skills add https://github.com/adelabdelgawad/rust-fullstack-agents --skill leptos-server-fn
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: leptos-server-fn
Source: https://github.com/adelabdelgawad/rust-fullstack-agents/tree/main/plugins/rusty/skills/leptos-server-fn
Command: npx skills add https://github.com/adelabdelgawad/rust-fullstack-agents --skill leptos-server-fn

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Leptos #[server] functions can be tricky to implement correctly; this skill guides encoding, extractor usage, response manipulation, and Send-bound requirements, and it auto-triggers when server fns are created or edited, helping you decide between server functions and plain Axum handlers and debugging common server fn issues.

Core Features & Use Cases

  • Pattern-driven guidance for encoding selection, extractor usage, and response shaping within #[server] functions.
  • Auto-triggers when adding or editing #[server] fns; helps decide between server fn vs Axum handler.
  • Practical examples and anti-patterns to accelerate correct implementation and debugging.

Quick Start

Add or edit a #[server] function in your Leptos project and follow this guide to implement correct encoding, extractors, and response handling.

Frequently Asked Questions about leptos-server-fn

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Why does my Leptos server function return a 500 error?

Leptos server functions return 500 errors when inputs or outputs lack Serialize + Deserialize bounds, or when async futures violate Send boundaries. Correct encoding selection and proper extractor usage prevent these runtime failures.

How do I use Axum extractors inside a Leptos server function?

You use Axum extractors within Leptos server functions by leveraging the context for response manipulation. The function must enforce Send bounds across async boundaries and apply correct encoding to ensure reliable data extraction.

When should I use a Leptos server function vs a plain Axum handler?

Use Leptos server functions when you need seamless type-safe client-server calls with automatic serialization. Choose plain Axum handlers when you need standard HTTP routing without enforcing Serialize + Deserialize bounds or Send requirements.

What encoding should I select for my Leptos server functions?

Encoding selection for Leptos server functions depends on your data transfer requirements. You must enforce Serialize for inputs and Deserialize for outputs to ensure correct data transmission and prevent processing errors.

How do I manipulate HTTP responses from a Leptos server function?

You manipulate HTTP responses from Leptos server functions by accessing and modifying the response via the function's context. This allows response shaping while maintaining required Send bounds across async boundaries.

Do Leptos server functions require Send bounds for async operations?

Yes, Leptos server functions require Send bounds across async boundaries to work reliably. Futures must be Send by design to prevent runtime issues and 500 errors during concurrent server execution.