Trait erlang_port::MessageSerialize[][src]

pub trait MessageSerialize {
    fn serialize_message(self) -> Vec<u8>;
}

Trait that serializes some data into a Vec

This is used in the send function to serialize commands. A default implementation is provided for anything implementing Serialize from serde.

In Erlang "Let it Crash" style, if we fail to serialize for whatever reason trait shoul panic. Since this library is intended to be used as part of an Erlang system this should be picked up by the BEAM VM which can restart the Port.

It's possible that panicing is not what you want, for example if you have a Port that is handling multiple commands concurrently. Feel free to make a PR or raise an issue to better support your use case if that is the case.

Required Methods

Implementors