use crate::Context;
use super::{Encode, Encoder};
pub trait TupleEncoder {
type Cx: ?Sized + Context;
type Ok;
type EncodeTupleField<'this>: Encoder<
Cx = Self::Cx,
Ok = Self::Ok,
Error = <Self::Cx as Context>::Error,
Mode = <Self::Cx as Context>::Mode,
>
where
Self: 'this;
#[must_use = "Encoder must be consumed"]
fn encode_tuple_field(
&mut self,
) -> Result<Self::EncodeTupleField<'_>, <Self::Cx as Context>::Error>;
#[inline]
fn push_tuple_field<T>(&mut self, value: T) -> Result<(), <Self::Cx as Context>::Error>
where
T: Encode<<Self::Cx as Context>::Mode>,
{
self.encode_tuple_field()?.encode(value)?;
Ok(())
}
fn end_tuple(self) -> Result<Self::Ok, <Self::Cx as Context>::Error>;
}