Trait osc_address::OscMessage [] [src]

pub trait OscMessage<'m>: Serialize + Deserialize<'m> {
    fn build_address(&self, string: &mut String);
    fn serialize_body<S: SerializeTuple>(
        &self,
        serializer: &mut S
    ) -> Result<(), S::Error>; fn deserialize_body<D: SeqAccess<'m>>(
        address: String,
        seq: D
    ) -> Result<Self, D::Error>; fn get_address(&self) -> String { ... } }

Type that exposes an OSC address and a message payload. Can be deserialized and serialized as if it were a (String, ([payload_arguments, ...])) sequence.

The functions exposed by this trait can generally be ignored by the programmer. They primarily facilitate implementing Serde serialization/deserialization in an ergonomic fashion.

Required Methods

Append the address that this message would be sent to into the given string. This is intended to be used as a builder method called by get_address. Generally, users should not directly call this function.

Serialize the payload of this message, and not its address. In the case that the variants of this message are also enumerated OscMessages, this method should recurse and serialize the final (i.e. leaf) message payload.

If seq represents the payload of an OSC message (i.e. the argument list), then this method deserializes the address + data into the appropriate enum variant.

In the case that Self is a struct and represents the payload of a message (without any address), then it is expected that address is either "" or "/".

Provided Methods

Determine the address that this message would be sent to, as a String. If this type is a struct (i.e. it represents just the payload of a message), then this method returns an empty string. In all other cases, it will return a string beginning with "/".

Implementors