pub trait TSerializable: Sized {
// Required methods
fn read_from_in_protocol<T: TInputProtocol>(i_prot: &mut T) -> Result<Self>;
fn write_to_out_protocol<T: TOutputProtocol>(
&self,
o_prot: &mut T,
) -> Result<()>;
}Expand description
Reads and writes the struct to Thrift protocols.
Unlike thrift::protocol::TSerializable this uses generics instead of trait objects
Required Methods§
Sourcefn read_from_in_protocol<T: TInputProtocol>(i_prot: &mut T) -> Result<Self>
fn read_from_in_protocol<T: TInputProtocol>(i_prot: &mut T) -> Result<Self>
Reads the struct from the input Thrift protocol
Sourcefn write_to_out_protocol<T: TOutputProtocol>(
&self,
o_prot: &mut T,
) -> Result<()>
fn write_to_out_protocol<T: TOutputProtocol>( &self, o_prot: &mut T, ) -> Result<()>
Writes the struct to the output Thrift protocol
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".