Module nannou_osc::encoder
source · Expand description
Encodes an OscPacket
to a byte vector.
Structs
- A newtype which can be used to wrap any type which implements
std::io::Seek
andstd::io::Write
to allow it to be used as anOutput
.
Traits
- A trait for values that can receive encoded OSC output via
encode_into
. This allows more flexibility in how the output is handled, including reusing part of an existing buffer or writing directly to an external sink (e.g. a file).
Functions
- Takes a reference to an OSC packet and returns a byte vector on success. If the packet was invalid an
OscError
is returned. - Takes a reference to an OSC packet and writes the encoded bytes to the given output. On success, the number of bytes written will be returned. If an error occurs during encoding, encoding will stop and the error will be returned. Note that in that case, the output may have been partially written!
- Null terminates the byte representation of string
s
and adds null bytes until the length of the result is a multiple of 4. - Writes the given string
s
to the given Output, adding 1-4 null bytes such that the length of the result is a multiple of 4. - Returns the position padded to 4 bytes.