aboutsummaryrefslogtreecommitdiff
path: root/src/wrapper.rs
blob: 0920ad4f4441d9baac82d214b30731d00a7e4340 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#[cfg(feature = "encryption")]
use crate::cfb8::CipherError;
use mcproto_rs::protocol::State;

pub trait CraftWrapper<I> {
    fn into_inner(self) -> I;
}

pub trait CraftIo {
    fn set_state(&mut self, next: State);

    #[cfg(feature = "compression")]
    fn set_compression_threshold(&mut self, threshold: Option<i32>);

    #[cfg(feature = "encryption")]
    fn enable_encryption(&mut self, key: &[u8], iv: &[u8]) -> Result<(), CipherError>;
}