hermes_encoding_components/traits/
decode_mut.rs

1use cgp::prelude::*;
2
3use crate::traits::types::decode_buffer::HasDecodeBufferType;
4
5#[derive_component(MutDecoderComponent, MutDecoder<Encoding>)]
6pub trait CanDecodeMut<Strategy, Value>: HasDecodeBufferType + HasErrorType {
7    fn decode_mut(&self, buffer: &mut Self::DecodeBuffer<'_>) -> Result<Value, Self::Error>;
8}
9
10#[derive_component(DecodeBufferPeekerComponent, DecodeBufferPeeker<Encoding>)]
11pub trait CanPeekDecodeBuffer<Value>: HasDecodeBufferType {
12    fn peek_decode_buffer<'a>(buffer: &'a mut Self::DecodeBuffer<'_>) -> Option<&'a Value>;
13}