Function erlang_port::send[][src]

pub fn send<T>(output: &mut Write, data: T) where
    T: Serialize

Writes an EETF Term into an io::Write along with it's size.

This can be used to send arbitrary commands to the Port inside the BEAM.

In Erlang "Let it Crash" style, if we fail to encode the command or write it to a stream we will 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 to better support your use case if that is the case.