hermes-encoding-components 0.1.0

Implementation of an IBC Relayer in Rust, as a library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use cgp::prelude::*;

use crate::traits::types::decode_buffer::HasDecodeBufferType;

#[derive_component(MutDecoderComponent, MutDecoder<Encoding>)]
pub trait CanDecodeMut<Strategy, Value>: HasDecodeBufferType + HasErrorType {
    fn decode_mut(&self, buffer: &mut Self::DecodeBuffer<'_>) -> Result<Value, Self::Error>;
}

#[derive_component(DecodeBufferPeekerComponent, DecodeBufferPeeker<Encoding>)]
pub trait CanPeekDecodeBuffer<Value>: HasDecodeBufferType {
    fn peek_decode_buffer<'a>(buffer: &'a mut Self::DecodeBuffer<'_>) -> Option<&'a Value>;
}