Skip to main content

Transcode

Struct Transcode 

Source
pub struct Transcode<M, C, In> { /* private fields */ }
Expand description

The upstream transcode_decode composite: relabel, then decode.

Closed under composition, which is what makes a tier change a change of artifact rather than a change of arithmetic (CK-04, CL-MM03).

The plan spells this Transcode<C1, C2>; the first parameter is a CodeMap rather than a second Codec, because a decode into the alphabet cannot be the input of another decode — only a relabelling can.

Implementations§

Source§

impl<M, C, In> Transcode<M, C, In>

Source

pub const fn new(map: M, inner: C) -> Self

Compose a relabelling with a decode.

Trait Implementations§

Source§

impl<M: Clone, C: Clone, In: Clone> Clone for Transcode<M, C, In>

Source§

fn clone(&self) -> Transcode<M, C, In>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<E, Bd, M, C, In> Codec<E, Bd> for Transcode<M, C, In>
where E: IntegerElement, Bd: Bound, C: Codec<E, Bd>, M: CodeMap<In, C::Code>, In: Copy + Send + Sync + 'static,

Source§

const MAX_BLOCK: usize = C::MAX_BLOCK

The most alphabet elements one code can produce. Read more
Source§

const TIER: TierId = TierId::Transcode

Which tier this is, for reports and for the kappa manifest.
Source§

const IS_FIXED_WIDTH: bool = C::IS_FIXED_WIDTH

Is decode_len always MAX_BLOCK? Read more
Source§

type Code = In

The stored code type. Read more
Source§

fn decode_element(&self, code: Self::Code, i: usize) -> Alphabet<E, Bd>

Decode element i of the block code names. Total for every i. Read more
Source§

fn decode_len(&self, _code: Self::Code) -> usize

How many elements code actually produces. Read more
Source§

fn decode_into(&self, code: Self::Code, out: &mut [Alphabet<E, Bd>]) -> usize

Decode one code, returning how many elements were written. Read more
Source§

fn decode_seq(&self, codes: &[Self::Code], out: &mut [Alphabet<E, Bd>]) -> usize

Bulk path, returning how many elements were written in total.
Source§

impl<M: Copy, C: Copy, In: Copy> Copy for Transcode<M, C, In>

Source§

impl<M: Debug, C: Debug, In: Debug> Debug for Transcode<M, C, In>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<M, C, In> Freeze for Transcode<M, C, In>
where M: Freeze, C: Freeze,

§

impl<M, C, In> RefUnwindSafe for Transcode<M, C, In>

§

impl<M, C, In> Send for Transcode<M, C, In>
where M: Send, C: Send,

§

impl<M, C, In> Sync for Transcode<M, C, In>
where M: Sync, C: Sync,

§

impl<M, C, In> Unpin for Transcode<M, C, In>
where M: Unpin, C: Unpin,

§

impl<M, C, In> UnsafeUnpin for Transcode<M, C, In>
where M: UnsafeUnpin, C: UnsafeUnpin,

§

impl<M, C, In> UnwindSafe for Transcode<M, C, In>
where M: UnwindSafe, C: 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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.