pub struct BaseEncoder<'a, 'b, T: Types> { /* private fields */ }Expand description
Implementations§
Source§impl<'a, 'b> BaseEncoder<'a, 'b, Alloc>
impl<'a, 'b> BaseEncoder<'a, 'b, Alloc>
Source§impl<'a, 'b, const MAX_FRAGMENT_LEN: usize, const MAX_SEQUENCE_COUNT: usize> BaseEncoder<'a, 'b, Heapless<MAX_FRAGMENT_LEN, MAX_SEQUENCE_COUNT>>
impl<'a, 'b, const MAX_FRAGMENT_LEN: usize, const MAX_SEQUENCE_COUNT: usize> BaseEncoder<'a, 'b, Heapless<MAX_FRAGMENT_LEN, MAX_SEQUENCE_COUNT>>
Sourcepub const fn new() -> Self
pub const fn new() -> Self
Construct a new HeaplessEncoder.
Source§impl<'a, 'b, T: Types> BaseEncoder<'a, 'b, T>
impl<'a, 'b, T: Types> BaseEncoder<'a, 'b, T>
Sourcepub fn current_sequence(&self) -> u32
pub fn current_sequence(&self) -> u32
Returns the current count of already emitted parts.
§Examples
encoder.start("bytes", "data".as_bytes(), 5);
assert_eq!(encoder.current_sequence(), 0);
encoder.next_part();
assert_eq!(encoder.current_sequence(), 1);Sourcepub fn sequence_count(&self) -> u32
pub fn sequence_count(&self) -> u32
Returns the number of segments the original message has been split up into.
§Examples
encoder.start("bytes", "data".as_bytes(), 3);
assert_eq!(encoder.sequence_count(), 2);Auto Trait Implementations§
impl<'a, 'b, T> Freeze for BaseEncoder<'a, 'b, T>where
<T as Types>::Data: Freeze,
<T as Types>::Indexes: Freeze,
<<T as Types>::Chooser as Types>::Indexes: Freeze,
<<T as Types>::Chooser as Types>::Shuffled: Freeze,
<<<T as Types>::Chooser as Types>::Sampler as Types>::Aliases: Freeze,
<<<T as Types>::Chooser as Types>::Sampler as Types>::Probs: Freeze,
<<<T as Types>::Chooser as Types>::Sampler as Types>::Weights: Freeze,
<<<T as Types>::Chooser as Types>::Sampler as Types>::S: Freeze,
<<<T as Types>::Chooser as Types>::Sampler as Types>::L: Freeze,
impl<'a, 'b, T> RefUnwindSafe for BaseEncoder<'a, 'b, T>where
<T as Types>::Data: RefUnwindSafe,
<T as Types>::Indexes: RefUnwindSafe,
<<T as Types>::Chooser as Types>::Indexes: RefUnwindSafe,
<<T as Types>::Chooser as Types>::Shuffled: RefUnwindSafe,
<<<T as Types>::Chooser as Types>::Sampler as Types>::Aliases: RefUnwindSafe,
<<<T as Types>::Chooser as Types>::Sampler as Types>::Probs: RefUnwindSafe,
<<<T as Types>::Chooser as Types>::Sampler as Types>::Weights: RefUnwindSafe,
<<<T as Types>::Chooser as Types>::Sampler as Types>::S: RefUnwindSafe,
<<<T as Types>::Chooser as Types>::Sampler as Types>::L: RefUnwindSafe,
impl<'a, 'b, T> Send for BaseEncoder<'a, 'b, T>where
<T as Types>::Data: Send,
<T as Types>::Indexes: Send,
<<T as Types>::Chooser as Types>::Indexes: Send,
<<T as Types>::Chooser as Types>::Shuffled: Send,
<<<T as Types>::Chooser as Types>::Sampler as Types>::Aliases: Send,
<<<T as Types>::Chooser as Types>::Sampler as Types>::Probs: Send,
<<<T as Types>::Chooser as Types>::Sampler as Types>::Weights: Send,
<<<T as Types>::Chooser as Types>::Sampler as Types>::S: Send,
<<<T as Types>::Chooser as Types>::Sampler as Types>::L: Send,
impl<'a, 'b, T> Sync for BaseEncoder<'a, 'b, T>where
<T as Types>::Data: Sync,
<T as Types>::Indexes: Sync,
<<T as Types>::Chooser as Types>::Indexes: Sync,
<<T as Types>::Chooser as Types>::Shuffled: Sync,
<<<T as Types>::Chooser as Types>::Sampler as Types>::Aliases: Sync,
<<<T as Types>::Chooser as Types>::Sampler as Types>::Probs: Sync,
<<<T as Types>::Chooser as Types>::Sampler as Types>::Weights: Sync,
<<<T as Types>::Chooser as Types>::Sampler as Types>::S: Sync,
<<<T as Types>::Chooser as Types>::Sampler as Types>::L: Sync,
impl<'a, 'b, T> Unpin for BaseEncoder<'a, 'b, T>where
<T as Types>::Data: Unpin,
<T as Types>::Indexes: Unpin,
<<T as Types>::Chooser as Types>::Indexes: Unpin,
<<T as Types>::Chooser as Types>::Shuffled: Unpin,
<<<T as Types>::Chooser as Types>::Sampler as Types>::Aliases: Unpin,
<<<T as Types>::Chooser as Types>::Sampler as Types>::Probs: Unpin,
<<<T as Types>::Chooser as Types>::Sampler as Types>::Weights: Unpin,
<<<T as Types>::Chooser as Types>::Sampler as Types>::S: Unpin,
<<<T as Types>::Chooser as Types>::Sampler as Types>::L: Unpin,
impl<'a, 'b, T> UnwindSafe for BaseEncoder<'a, 'b, T>where
<T as Types>::Data: UnwindSafe,
<T as Types>::Indexes: UnwindSafe,
<<T as Types>::Chooser as Types>::Indexes: UnwindSafe,
<<T as Types>::Chooser as Types>::Shuffled: UnwindSafe,
<<<T as Types>::Chooser as Types>::Sampler as Types>::Aliases: UnwindSafe,
<<<T as Types>::Chooser as Types>::Sampler as Types>::Probs: UnwindSafe,
<<<T as Types>::Chooser as Types>::Sampler as Types>::Weights: UnwindSafe,
<<<T as Types>::Chooser as Types>::Sampler as Types>::S: UnwindSafe,
<<<T as Types>::Chooser as Types>::Sampler as Types>::L: 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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more