pub trait NetStateMachine: Sized + Send {
    type Init: Debug;
    type Artifact;
    type Error: Error;

    const NAME: &'static str;

    fn init(&mut self, init: Self::Init);
    fn next_read_len(&self) -> usize;
    fn advance(&mut self, input: &[u8]) -> Result<Vec<u8>, Self::Error>;
    fn artifact(&self) -> Option<Self::Artifact>;
    fn is_init(&self) -> bool;

    fn run_handshake(&mut self, stream: &mut impl NetStream) -> Result<()> { ... }
    fn is_complete(&self) -> bool { ... }
}

Required Associated Types§

Required Associated Constants§

Required Methods§

Provided Methods§

Implementations on Foreign Types§

Implementors§