MCPcopy Create free account
hub / github.com/dcSpark/cddl-codegen / DepthGuard

Class DepthGuard

static/serialization_depth_guard.rs:15–15  ·  view source on GitHub ↗

RAII guard bounding the nesting depth of composite deserializers. `acquire` increments a thread-local counter and `Drop` decrements it, so early returns / `?`-propagation unwind the count correctly. Acquiring past `limit` returns a `DepthLimitExceeded` error rather than recursing further.

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected