ResultBudget
A transport-owned bound on the serialized result, never an authorization grant.
ResultBudget::__construct()
public function __construct(int $maxCharacters, Closure $encoder):Parameters
| Name | Type | Description |
|---|---|---|
| $maxCharacters | int | |
| $encoder | \Closure(mixed): string | The same encoder the transport uses for this result. |
ResultBudget::json()
public static function json(int $maxCharacters): selfThe JSON array encoding used by the model tool loop, with Unicode preserved.
Parameters
| Name | Type | Description |
|---|---|---|
| $maxCharacters | int |
ResultBudget::encode()
public function encode(?mixed $value): stringEncode with the transport's ruler; source bytes and JSON characters are different units.
Parameters
| Name | Type | Description |
|---|---|---|
| $value | ?mixed |
ResultBudget::fits()
public function fits(?mixed $value): boolWhether the entire encoded result fits, including its metadata.
Parameters
| Name | Type | Description |
|---|---|---|
| $value | ?mixed |
ResultBudget::tightenedTo()
public function tightenedTo(int $maxCharacters): selfA producer may request less room; it cannot expand the transport's allowance.
Parameters
| Name | Type | Description |
|---|---|---|
| $maxCharacters | int |