pub trait AsTuple: Serialize {
// Provided methods
fn serialize_as_tuple(&self) -> Result<TupleBuffer> { ... }
fn serialize(&self) -> Result<Vec<u8>> { ... }
fn serialize_to(&self, w: &mut impl Write) -> Result<()> { ... }
}
👎Deprecated: This is a legacy trait which will be removed in future. Implement
Encode
for custom types instead. Use ToTupleBuffer
if you need the tuple data instead.Expand description
AsTuple Must be implemented for types, which will be used with box access methods as data
Provided Methods§
sourcefn serialize_as_tuple(&self) -> Result<TupleBuffer>
fn serialize_as_tuple(&self) -> Result<TupleBuffer>
👎Deprecated: This is a legacy trait which will be removed in future. Implement
Encode
for custom types instead. Use ToTupleBuffer
if you need the tuple data instead.Describes how object can be converted to Tuple.
Has default implementation, but can be overloaded for special cases
sourcefn serialize(&self) -> Result<Vec<u8>>
fn serialize(&self) -> Result<Vec<u8>>
👎Deprecated: This is a legacy trait which will be removed in future. Implement
Encode
for custom types instead. Use ToTupleBuffer
if you need the tuple data instead.sourcefn serialize_to(&self, w: &mut impl Write) -> Result<()>
fn serialize_to(&self, w: &mut impl Write) -> Result<()>
👎Deprecated: This is a legacy trait which will be removed in future. Implement
Encode
for custom types instead. Use ToTupleBuffer
if you need the tuple data instead.