Skip to main content
Run any Skill in Manus
with one click

ref-struct-delegates

Stars196
Forks21
UpdatedMay 12, 2026 at 16:43

Replace Func<> and Action<> with custom delegate types when any parameter or return type is a ref struct (Span<T>, ReadOnlySpan<T>, etc.). Ref structs cannot appear as generic type arguments, so Func<ReadOnlySpan<byte>, bool> is a compile error. The fix is a named delegate. USE FOR: writing public APIs that accept callbacks involving spans, storing span-accepting lambdas in fields, wrapping IJsonPathFunction or similar interfaces with delegate-based factories. DO NOT USE FOR: APIs where all parameters are regular (non-ref-struct) types — plain Func<>/Action<> is fine there.

Installation

Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.

SKILL.md
readonly