Specifically, `OnionMessageContents` is a non-cloneable enum, which
isn't stored opaque so we cannot call `&self` methods on it.
Because its methods aren't critical to the API for now, we simply
no-export them rather than trying to work out an alternative
approach.
impl<T: CustomOnionMessageContents> OnionMessageContents<T> {
/// Returns the type that was used to decode the message payload.
+ ///
+ /// (C-not exported) as methods on non-cloneable enums are not currently exportable
pub fn tlv_type(&self) -> u64 {
match self {
&OnionMessageContents::Custom(ref msg) => msg.tlv_type(),
}
}
+/// (C-not exported) as methods on non-cloneable enums are not currently exportable
impl<T: CustomOnionMessageContents> Writeable for OnionMessageContents<T> {
fn write<W: Writer>(&self, w: &mut W) -> Result<(), io::Error> {
match self {