Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pub trait AsyncRead {}
- pub trait AsyncWrite {}
- pub struct NoopStream;
- impl AsyncRead for NoopStream {}
- impl AsyncWrite for NoopStream {}
- pub trait Processor<T = NoopStream>
- where
- T: AsyncRead + AsyncWrite {}
- pub struct NoopProcessor;
- impl<T> Processor<T> for NoopProcessor
- where
- T: AsyncRead + AsyncWrite {}
- pub struct Runner<P, RW>
- where
- P: Processor<RW>
- {
- processor: P,
- }
- impl<P, RW> Runner<P, RW> {
- pub fn new(processor: P)
- where
- P: Processor<RW>,
- {
- Runner { processor, }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement