Make codec shape authority compile-time and fixed

This commit is contained in:
ms2k 2026-07-19 04:33:43 +09:00
commit 54cc167f81

View file

@ -300,7 +300,7 @@ impl ControlClient {
///
/// # Errors
/// Returns encoding, size, or stream failures.
pub fn send<T: serde::Serialize>(
pub fn send<T: lazaret_core::records::SchemaType + serde::Serialize>(
stream: &mut impl Write,
record: &T,
) -> Result<(), ControlClientError> {
@ -327,7 +327,7 @@ impl ControlClient {
/// Returns framing, size, decoding, or stream failures.
pub fn receive<T>(stream: &mut impl Read) -> Result<T, ControlClientError>
where
T: serde::de::DeserializeOwned + serde::Serialize,
T: lazaret_core::records::SchemaType + serde::de::DeserializeOwned + serde::Serialize,
{
let mut length = [0_u8; 4];
stream.read_exact(&mut length)?;