Documentation
¶
Overview ¶
Package capabilitydata bounds and isolates data graphs crossing host capabilities.
Index ¶
- Constants
- func WithBudget(ctx context.Context, budget *Budget) context.Context
- type Budget
- type Cloner
- func (c *Cloner) Clone(label string, source value.Value) (value.Value, error)
- func (c *Cloner) CloneWithOptions(label string, source value.Value, options Options) (value.Value, error)
- func (c *Cloner) Hash(label string, source value.Value) (map[string]value.Value, error)
- func (c *Cloner) Kwargs(method string, source map[string]value.Value) (map[string]value.Value, error)
- func (c *Cloner) KwargsWithOptions(method string, source map[string]value.Value, options Options) (map[string]value.Value, error)
- type Execution
- type Options
- type Validator
Constants ¶
const MaxDepth = 256
MaxDepth is the existing capability payload nesting limit.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Budget ¶
type Budget struct {
// contains filtered or unexported fields
}
Budget accounts for cumulative work and allocations across independent snapshots in one operation. Callers must use it sequentially and release their external reservation after the operation. Nil hooks retain the standalone hard limits.
func ExecutionBudget ¶
ExecutionBudget uses the runtime's private provider when available, preserving the existing public execution interfaces for direct embedders.
func NewBudget ¶
NewBudget creates a bounded operation with optional interpreter step and memory hooks. Each charged step represents 64 units of graph or byte work.
func UnpackBudget ¶
UnpackBudget returns the exact original context and operation budget. Ordinary callers receive a standalone budget; no state is stored on their context.
func (*Budget) Reserve ¶
Reserve checks allocation size before it is passed to make or a constructor.
func (*Budget) ReserveMap ¶
ReserveMap checks space for a cloned string-keyed map before allocation.
func (*Budget) SetSnapshotRefresh ¶
SetSnapshotRefresh installs the runtime hook that refreshes live memory after a host call or script callback changes the operation's reachable roots.
type Cloner ¶
type Cloner struct {
// contains filtered or unexported fields
}
Cloner preserves shared children across every root of one immutable input graph. Create a new Cloner after invoking host code or yielding a snapshot; reuse its Budget to retain cumulative limits without retaining stale clones.
func (*Cloner) CloneWithOptions ¶
func (c *Cloner) CloneWithOptions(label string, source value.Value, options Options) (value.Value, error)
CloneWithOptions applies a root's existing containment policy. Tag-free data shares its clone across policies; tagged ancestors receive separate views.
type Options ¶
Options preserves the distinct contracts of validated option parsers and runtime containment copies. The default rejects runtime values and strips tags.
type Validator ¶
type Validator struct {
// contains filtered or unexported fields
}
Validator checks a complete argument graph without copying its containers. Depth errors precede callable errors, which precede cycle errors.
func NewValidator ¶
NewValidator starts a validation memo sharing the operation's budget.