pub struct ValueWireV1Seed;Expand description
Explicit Serde seed for decoding one V1 envelope.
Use this seed with a decoder that enforces the resource limits appropriate
for the surrounding document. For complete JSON input, prefer the bounded
JSON decode helpers on ValueWireV1.
Errors from decoding the envelope use a fixed diagnostic so malformed
field names and values from untrusted input are not disclosed. Bounded
helpers provide richer safe metadata through InvalidJson. Resource
limits do not sanitize diagnostics, and reader or writer I/O sources may
contain application-defined details that require the application’s logging
policy.
§Examples
With the json feature, a complete envelope can be decoded through the
public JsonDecoder entry point:
use qubit_budget::json::{JsonDecodeLimits, JsonDecodeSession};
use qubit_json::decode::JsonDecoder;
use qubit_value::ValueWireV1Seed;
let limits = JsonDecodeLimits::builder().max_input_bytes(256usize).build();
let session = JsonDecodeSession::from_limits(limits);
let mut decoder = JsonDecoder::new(session);
let value = decoder.decode_unique_seed_utf8(
ValueWireV1Seed::new(),
br#"{"version":1,"value":{"scalar":{"int32":7}}}"#,
)?;
assert_eq!(value.into_container().data_type(), qubit_datatype::DataType::Int32);Implementations§
Trait Implementations§
Source§impl Clone for ValueWireV1Seed
impl Clone for ValueWireV1Seed
impl Copy for ValueWireV1Seed
Source§impl Debug for ValueWireV1Seed
impl Debug for ValueWireV1Seed
Source§impl Default for ValueWireV1Seed
impl Default for ValueWireV1Seed
Source§impl<'de> DeserializeSeed<'de> for ValueWireV1Seed
impl<'de> DeserializeSeed<'de> for ValueWireV1Seed
Source§type Value = ValueWireV1
type Value = ValueWireV1
Validated V1 envelope produced by decoding the input.
Source§fn deserialize<D>(self, deserializer: D) -> Result<Self::Value, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(self, deserializer: D) -> Result<Self::Value, D::Error>where
D: Deserializer<'de>,
Deserializes one validated V1 runtime container into the DTO.
§Type Parameters
D- Serde deserializer supplying the V1 envelope, with input borrows valid for'de.
§Parameters
self- Stateless seed consumed by the decoding operation.deserializer- Source of the envelope; the caller is responsible for enforcing appropriate resource limits.
§Returns
The decoded and version-validated V1 envelope.
§Errors
Returns D::Error if decoding fails or the envelope declares an
unsupported version. Malformed envelope diagnostics do not include
input-derived field names or values.