pub struct EncodePlan<A> {
pub max_output_units: usize,
pub action: A,
}Expand description
Describes how much output capacity one encoded value needs before writing.
EncodePlan is produced by crate::BufferedEncodeHooks::prepare_encode
and consumed by crate::BufferedEncodeHooks::write_encode. The capacity
field is a safe upper bound required by the concrete writer, not necessarily
the exact number of units that will be written.
§Type Parameters
A: Concrete action interpreted by the encoder implementation.
Fields§
§max_output_units: usizeOutput units that must be writable before calling write_encode.
Default codec-backed encoders usually use
crate::Codec::max_units_per_value. Domain-specific encoders may use
a tighter bound, such as a charset encoder using its exact encoded
length probe. A value of zero is valid for policies that consume input
without producing output.
action: AConcrete write action interpreted by the encoder implementation.
Implementations§
Trait Implementations§
Source§impl<A: Clone> Clone for EncodePlan<A>
impl<A: Clone> Clone for EncodePlan<A>
Source§fn clone(&self) -> EncodePlan<A>
fn clone(&self) -> EncodePlan<A>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<A: Copy> Copy for EncodePlan<A>
Source§impl<A: Debug> Debug for EncodePlan<A>
impl<A: Debug> Debug for EncodePlan<A>
impl<A: Eq> Eq for EncodePlan<A>
Source§impl<A: Hash> Hash for EncodePlan<A>
impl<A: Hash> Hash for EncodePlan<A>
Source§impl<A: PartialEq> PartialEq for EncodePlan<A>
impl<A: PartialEq> PartialEq for EncodePlan<A>
Source§fn eq(&self, other: &EncodePlan<A>) -> bool
fn eq(&self, other: &EncodePlan<A>) -> bool
Tests for
self and other values to be equal, and is used by ==.impl<A> StructuralPartialEq for EncodePlan<A>
Auto Trait Implementations§
impl<A> Freeze for EncodePlan<A>where
A: Freeze,
impl<A> RefUnwindSafe for EncodePlan<A>where
A: RefUnwindSafe,
impl<A> Send for EncodePlan<A>where
A: Send,
impl<A> Sync for EncodePlan<A>where
A: Sync,
impl<A> Unpin for EncodePlan<A>where
A: Unpin,
impl<A> UnsafeUnpin for EncodePlan<A>where
A: UnsafeUnpin,
impl<A> UnwindSafe for EncodePlan<A>where
A: 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