Trait strict_encoding::WriteUnion
source · pub trait WriteUnion: Sized {
type Parent: TypedWrite;
type TupleWriter: WriteTuple<Parent = Self>;
type StructWriter: WriteStruct<Parent = Self>;
// Required methods
fn write_unit(self, name: FieldName) -> Result<Self>;
fn write_tuple(
self,
name: FieldName,
inner: impl FnOnce(Self::TupleWriter) -> Result<Self>
) -> Result<Self>;
fn write_struct(
self,
name: FieldName,
inner: impl FnOnce(Self::StructWriter) -> Result<Self>
) -> Result<Self>;
fn complete(self) -> Self::Parent;
// Provided method
fn write_newtype(
self,
name: FieldName,
value: &impl StrictEncode
) -> Result<Self> { ... }
}
Required Associated Types§
type Parent: TypedWrite
type TupleWriter: WriteTuple<Parent = Self>
type StructWriter: WriteStruct<Parent = Self>
Required Methods§
fn write_unit(self, name: FieldName) -> Result<Self>
fn write_tuple( self, name: FieldName, inner: impl FnOnce(Self::TupleWriter) -> Result<Self> ) -> Result<Self>
fn write_struct( self, name: FieldName, inner: impl FnOnce(Self::StructWriter) -> Result<Self> ) -> Result<Self>
fn complete(self) -> Self::Parent
Provided Methods§
fn write_newtype( self, name: FieldName, value: &impl StrictEncode ) -> Result<Self>
Object Safety§
This trait is not object safe.