From: Ian Jackson Date: Tue, 1 Jun 2021 10:30:27 +0000 (+0100) Subject: mgmtchannel: Insist that client connections are Debug X-Git-Tag: otter-0.7.0~157 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=088517b8811cfbf575dbec5f1a7aac8868332e59;p=otter.git mgmtchannel: Insist that client connections are Debug Signed-off-by: Ian Jackson --- diff --git a/src/mgmtchannel.rs b/src/mgmtchannel.rs index a4771e09..c1dcc431 100644 --- a/src/mgmtchannel.rs +++ b/src/mgmtchannel.rs @@ -46,10 +46,15 @@ impl Debug for MgmtChannel where R: Read, W: Write { } pub type ClientMgmtChannel = MgmtChannel< - Box, - Box, + Box, + Box, >; +pub trait ReadDebug: Read + Debug { } +pub trait WriteDebug: Write + Debug { } +impl ReadDebug for T where T: Read + Debug { } +impl WriteDebug for T where T: Write + Debug { } + impl ClientMgmtChannel { #[throws(AE)] pub fn connect(socket_path: &str) -> Self { @@ -62,8 +67,8 @@ impl ClientMgmtChannel { } pub fn new_boxed(read: R, write: W) -> Self - where R: Read + Send + 'static, - W: Write + Send + 'static { + where R: ReadDebug + Send + 'static, + W: WriteDebug + Send + 'static { MgmtChannel::new_raw(Box::new(read), Box::new(write)) } }