diff --git a/src/client/server/mod.rs b/src/client/server/mod.rs index 5c29226..472f904 100644 --- a/src/client/server/mod.rs +++ b/src/client/server/mod.rs @@ -17,7 +17,7 @@ use client::data::kinds::{IrcRead, IrcWrite}; pub mod utils; /// Trait describing core Server functionality. -pub trait Server<'a, T, U> { +pub trait Server<'a, T: IrcRead, U: IrcWrite> { /// Gets the configuration being used with this Server. fn config(&self) -> &Config; /// Sends a Command to this Server. @@ -262,7 +262,7 @@ pub struct ServerIterator<'a, T: IrcRead + 'a, U: IrcWrite + 'a> { } /// An Iterator over an IrcServer's incoming Commands. -pub type ServerCmdIterator<'a, T: IrcRead + 'a, U: IrcWrite + 'a> = +pub type ServerCmdIterator<'a, T, U> = Map, fn(Result) -> Result>; impl<'a, T: IrcRead + 'a, U: IrcWrite + 'a> ServerIterator<'a, T, U> { diff --git a/src/client/server/utils.rs b/src/client/server/utils.rs index 0e6d9db..754e83b 100644 --- a/src/client/server/utils.rs +++ b/src/client/server/utils.rs @@ -10,7 +10,7 @@ use client::data::kinds::{IrcRead, IrcWrite}; use client::server::Server; /// Extensions for Server capabilities that make it easier to work directly with the protocol. -pub trait ServerExt<'a, T, U>: Server<'a, T, U> { +pub trait ServerExt<'a, T: IrcRead, U: IrcWrite>: Server<'a, T, U> { /// Sends a request for a list of server capabilities for a specific IRCv3 version. fn send_cap_ls(&self, version: NegotiationVersion) -> Result<()> where Self: Sized { self.send(CAP(None, LS, match version {