pub struct StructWriter<W: Write, P: StrictParent<W>> { /* private fields */ }

Implementations§

source§

impl<W: Write, P: StrictParent<W>> StructWriter<W, P>

source

pub fn structure<T: StrictStruct>(parent: P) -> Self

source

pub fn tuple<T: StrictTuple>(parent: P) -> Self

source

pub fn unnamed(parent: P, tuple: bool) -> Self

source

pub fn is_tuple(&self) -> bool

source

pub fn is_struct(&self) -> bool

source

pub fn named_fields(&self) -> &[FieldName]

source

pub fn fields_count(&self) -> u8

source

pub fn name(&self) -> &str

source

pub fn into_parent(self) -> P

Trait Implementations§

source§

impl<W: Debug + Write, P: Debug + StrictParent<W>> Debug for StructWriter<W, P>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<W: Write, P: StrictParent<W>> DefineStruct for StructWriter<W, P>

§

type Parent = P

source§

fn define_field<T: StrictEncode>(self, field: FieldName) -> Self

source§

fn complete(self) -> P

source§

impl<W: Write, P: StrictParent<W>> DefineTuple for StructWriter<W, P>

§

type Parent = P

source§

fn define_field<T: StrictEncode>(self) -> Self

source§

fn complete(self) -> P

source§

impl<W: Write, P: StrictParent<W>> SplitParent for StructWriter<W, P>

§

type Parent = P

§

type Remnant = StructWriter<Sink, ParentDumb>

source§

fn from_parent_split(parent: P, remnant: Self::Remnant) -> Self

source§

fn into_parent_split(self) -> (P, Self::Remnant)

source§

impl<W: Write, P: StrictParent<W>> WriteStruct for StructWriter<W, P>

§

type Parent = P

source§

fn write_field( self, _field: FieldName, value: &impl StrictEncode ) -> Result<Self>

source§

fn complete(self) -> P

source§

impl<W: Write, P: StrictParent<W>> WriteTuple for StructWriter<W, P>

§

type Parent = P

source§

fn write_field(self, value: &impl StrictEncode) -> Result<Self>

source§

fn complete(self) -> P

Auto Trait Implementations§

§

impl<W, P> RefUnwindSafe for StructWriter<W, P>

§

impl<W, P> Send for StructWriter<W, P>
where P: Send, W: Send,

§

impl<W, P> Sync for StructWriter<W, P>
where P: Sync, W: Sync,

§

impl<W, P> Unpin for StructWriter<W, P>
where P: Unpin, W: Unpin,

§

impl<W, P> UnwindSafe for StructWriter<W, P>
where P: UnwindSafe, W: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.