strict_encoding

Struct StrictWriter

Source
pub struct StrictWriter<W: WriteRaw>(/* private fields */);

Implementations§

Source§

impl StrictWriter<StreamWriter<Vec<u8>>>

Source

pub fn in_memory<const MAX: usize>() -> Self

Source§

impl StrictWriter<StreamWriter<WriteCounter>>

Source

pub fn counter<const MAX: usize>() -> Self

Source§

impl StrictWriter<StreamWriter<Sink>>

Source

pub fn sink<const MAX: usize>() -> Self

Source§

impl<W: WriteRaw> StrictWriter<W>

Source

pub fn with(writer: W) -> Self

Source

pub fn unbox(self) -> W

Trait Implementations§

Source§

impl<W: Debug + WriteRaw> Debug for StrictWriter<W>

Source§

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

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

impl<W: WriteRaw> From<W> for StrictWriter<W>

Source§

fn from(v: W) -> Self

Converts to this type from the input type.
Source§

impl<W: WriteRaw> StrictParent<W> for StrictWriter<W>

Source§

type Remnant = ()

Source§

fn from_write_split(writer: StrictWriter<W>, _: Self::Remnant) -> Self

Source§

fn into_write_split(self) -> (StrictWriter<W>, Self::Remnant)

Source§

impl<W: WriteRaw> TypedWrite for StrictWriter<W>

Source§

type TupleWriter = StructWriter<W, StrictWriter<W>>

Source§

type StructWriter = StructWriter<W, StrictWriter<W>>

Source§

type UnionDefiner = UnionWriter<W>

Source§

type RawWriter = W

Source§

fn write_union<T: StrictUnion>( self, inner: impl FnOnce(Self::UnionDefiner) -> Result<Self>, ) -> Result<Self>

Source§

fn write_enum<T: StrictEnum>(self, value: T) -> Result<Self>
where u8: From<T>,

Source§

fn write_tuple<T: StrictTuple>( self, inner: impl FnOnce(Self::TupleWriter) -> Result<Self>, ) -> Result<Self>

Source§

fn write_struct<T: StrictStruct>( self, inner: impl FnOnce(Self::StructWriter) -> Result<Self>, ) -> Result<Self>

Source§

fn write_newtype<T: StrictTuple>( self, value: &impl StrictEncode, ) -> Result<Self>

Source§

impl<W: WriteRaw> TypedParent for StrictWriter<W>

Auto Trait Implementations§

§

impl<W> Freeze for StrictWriter<W>
where W: Freeze,

§

impl<W> RefUnwindSafe for StrictWriter<W>
where W: RefUnwindSafe,

§

impl<W> Send for StrictWriter<W>
where W: Send,

§

impl<W> Sync for StrictWriter<W>
where W: Sync,

§

impl<W> Unpin for StrictWriter<W>
where W: Unpin,

§

impl<W> UnwindSafe for StrictWriter<W>
where 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>,

Source§

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>,

Source§

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.