pub struct UnionWriter<W: WriteRaw> { /* private fields */ }
Implementations§
Source§impl UnionWriter<StreamWriter<Sink>>
impl UnionWriter<StreamWriter<Sink>>
Source§impl<W: WriteRaw> UnionWriter<W>
impl<W: WriteRaw> UnionWriter<W>
pub fn with<T: StrictSum>(parent: StrictWriter<W>) -> Self
pub fn is_written(&self) -> bool
pub fn variants(&self) -> &BTreeMap<Variant, VariantType>
pub fn name(&self) -> &str
pub fn tag_by_name(&self, name: &VariantName) -> u8
Trait Implementations§
Source§impl<W: WriteRaw> DefineEnum for UnionWriter<W>
impl<W: WriteRaw> DefineEnum for UnionWriter<W>
type Parent = StrictWriter<W>
type EnumWriter = UnionWriter<W>
fn define_variant(self, name: VariantName) -> Self
fn complete(self) -> Self::EnumWriter
Source§impl<W: WriteRaw> DefineUnion for UnionWriter<W>
impl<W: WriteRaw> DefineUnion for UnionWriter<W>
type Parent = StrictWriter<W>
type TupleDefiner = StructWriter<W, UnionWriter<W>>
type StructDefiner = StructWriter<W, UnionWriter<W>>
type UnionWriter = UnionWriter<W>
fn define_unit(self, name: VariantName) -> Self
fn define_tuple( self, name: VariantName, inner: impl FnOnce(Self::TupleDefiner) -> Self, ) -> Self
fn define_struct( self, name: VariantName, inner: impl FnOnce(Self::StructDefiner) -> Self, ) -> Self
fn complete(self) -> Self::UnionWriter
fn define_newtype<T: StrictEncode + StrictDumb>(self, name: VariantName) -> Self
Source§impl<W: WriteRaw> StrictParent<W> for UnionWriter<W>
impl<W: WriteRaw> StrictParent<W> for UnionWriter<W>
type Remnant = UnionWriter<StreamWriter<Sink>>
fn from_write_split(writer: StrictWriter<W>, remnant: Self::Remnant) -> Self
fn into_write_split(self) -> (StrictWriter<W>, Self::Remnant)
Source§impl<W: WriteRaw> WriteEnum for UnionWriter<W>
impl<W: WriteRaw> WriteEnum for UnionWriter<W>
type Parent = StrictWriter<W>
fn write_variant(self, name: VariantName) -> Result<Self>
fn complete(self) -> Self::Parent
Source§impl<W: WriteRaw> WriteUnion for UnionWriter<W>
impl<W: WriteRaw> WriteUnion for UnionWriter<W>
type Parent = StrictWriter<W>
type TupleWriter = StructWriter<W, UnionWriter<W>>
type StructWriter = StructWriter<W, UnionWriter<W>>
fn write_unit(self, name: VariantName) -> Result<Self>
fn write_tuple( self, name: VariantName, inner: impl FnOnce(Self::TupleWriter) -> Result<Self>, ) -> Result<Self>
fn write_struct( self, name: VariantName, inner: impl FnOnce(Self::StructWriter) -> Result<Self>, ) -> Result<Self>
fn complete(self) -> Self::Parent
fn write_newtype( self, name: VariantName, value: &impl StrictEncode, ) -> Result<Self>
impl<W: WriteRaw> TypedParent for UnionWriter<W>
Auto Trait Implementations§
impl<W> Freeze for UnionWriter<W>where
W: Freeze,
impl<W> RefUnwindSafe for UnionWriter<W>where
W: RefUnwindSafe,
impl<W> Send for UnionWriter<W>where
W: Send,
impl<W> Sync for UnionWriter<W>where
W: Sync,
impl<W> Unpin for UnionWriter<W>where
W: Unpin,
impl<W> UnwindSafe for UnionWriter<W>where
W: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more