+// Implement Type for Infallible, note that it cannot be constructed, and thus you can never call a
+// method that takes self for it.
+impl wire::Type for Infallible {
+ fn type_id(&self) -> u16 {
+ unreachable!();
+ }
+}
+impl Writeable for Infallible {
+ fn write<W: Writer>(&self, _: &mut W) -> Result<(), io::Error> {
+ unreachable!();
+ }
+}
+
+impl wire::CustomMessageReader for IgnoringMessageHandler {
+ type CustomMessage = Infallible;
+ fn read<R: io::Read>(&self, _message_type: u16, _buffer: &mut R) -> Result<Option<Self::CustomMessage>, msgs::DecodeError> {
+ Ok(None)
+ }
+}
+
+impl CustomMessageHandler for IgnoringMessageHandler {
+ fn handle_custom_message(&self, _msg: Infallible, _sender_node_id: &PublicKey) -> Result<(), LightningError> {
+ // Since we always return `None` in the read the handle method should never be called.
+ unreachable!();
+ }
+
+ fn get_and_clear_pending_msg(&self) -> Vec<(PublicKey, Self::CustomMessage)> { Vec::new() }
+}
+