Skip to main content

vyre_driver_wgpu/runtime/
serializer.rs

1//! Runtime wire-format serialization for multi-part programs.
2
3/// Owner-local runtime framing failure.
4#[derive(Clone, Debug, Eq, PartialEq, thiserror::Error)]
5pub enum SerializerError {
6    /// Input bytes do not satisfy the framing contract.
7    #[error("invalid runtime frame: {message}")]
8    InvalidFrame {
9        /// Actionable framing failure.
10        message: String,
11    },
12    /// Frame encoding, decoding, sizing, or allocation failed.
13    #[error("runtime frame serialization failed: {message}")]
14    Serialization {
15        /// Actionable serialization failure.
16        message: String,
17    },
18}
19
20/// Runtime framing result.
21pub type SerializerResult<T, E = SerializerError> = Result<T, E>;
22
23pub use decode_parts::decode_parts;
24pub use encode_parts::{encode_parts, MAX_SERIALIZED_PART_BYTES};
25
26/// Runtime frame decoder.
27pub mod decode_parts;
28/// Runtime frame encoder and serializer limits.
29pub mod encode_parts;