pub struct StrictWriter<W: Write>(_);

Implementations§

source§

impl StrictWriter<Vec<u8>>

source

pub fn in_memory(limit: usize) -> Self

source§

impl StrictWriter<WriteCounter>

source

pub fn counter() -> Self

source§

impl StrictWriter<Sink>

source

pub fn sink() -> Self

source§

impl<W: Write> StrictWriter<W>

source

pub fn with(limit: usize, writer: W) -> Self

source

pub fn unbox(self) -> W

Trait Implementations§

source§

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

source§

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

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

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

§

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: Write> TypedWrite for StrictWriter<W>

§

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

§

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

§

type UnionDefiner = UnionWriter<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: Write> TypedParent for StrictWriter<W>

Auto Trait Implementations§

§

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 Twhere
    T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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 Twhere
    U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.