Struct DivansRecodeState

Source
pub struct DivansRecodeState<RingBuffer: SliceWrapperMut<u8> + SliceWrapper<u8>> {
    pub ring_buffer: RingBuffer,
    /* private fields */
}

Fields§

§ring_buffer: RingBuffer

Implementations§

Source§

impl<RingBuffer: SliceWrapperMut<u8> + SliceWrapper<u8>> DivansRecodeState<RingBuffer>

Source

pub fn new(rb: RingBuffer) -> Self

Source

pub fn snapshot_ringbuffer(&self) -> RingBufferIndexState

Source

pub fn restore_ringbuffer_to_snapshot(&mut self, data: RingBufferIndexState)

Source

pub fn num_bytes_encoded(&self) -> usize

Source

pub fn last_8_literals(&self) -> [u8; 8]

Source

pub fn flush( &mut self, output: &mut [u8], output_offset: &mut usize, ) -> DivansOutputResult

Source

pub fn encode_cmd<SliceType: SliceWrapper<u8>>( &mut self, cmd: &Command<SliceType>, output: &mut [u8], output_offset: &mut usize, ) -> DivansOutputResult

Trait Implementations§

Source§

impl<RingBuffer: SliceWrapperMut<u8> + SliceWrapper<u8> + Default> Compressor for DivansRecodeState<RingBuffer>

Source§

fn encode( &mut self, input: &[u8], input_offset: &mut usize, output: &mut [u8], output_offset: &mut usize, ) -> DivansResult

Source§

fn encode_commands<SliceType: SliceWrapper<u8>>( &mut self, input: &[Command<SliceType>], input_offset: &mut usize, output: &mut [u8], output_offset: &mut usize, ) -> DivansOutputResult

Source§

fn flush( &mut self, _output: &mut [u8], _output_offset: &mut usize, ) -> DivansOutputResult

Source§

impl<RingBuffer: SliceWrapperMut<u8> + SliceWrapper<u8> + Default> Default for DivansRecodeState<RingBuffer>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<RingBuffer> Freeze for DivansRecodeState<RingBuffer>
where RingBuffer: Freeze,

§

impl<RingBuffer> RefUnwindSafe for DivansRecodeState<RingBuffer>
where RingBuffer: RefUnwindSafe,

§

impl<RingBuffer> Send for DivansRecodeState<RingBuffer>
where RingBuffer: Send,

§

impl<RingBuffer> Sync for DivansRecodeState<RingBuffer>
where RingBuffer: Sync,

§

impl<RingBuffer> Unpin for DivansRecodeState<RingBuffer>
where RingBuffer: Unpin,

§

impl<RingBuffer> UnwindSafe for DivansRecodeState<RingBuffer>
where RingBuffer: 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.