Currently only covers what is needed to keep code compiling, plus
everything caps/structure/tags related.
This avoids unnecessary heap allocations for adding the NUL-terminator
of C strings, and especially makes caps/structure handling as efficient
as in C.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1190>
Attention: these changes induce breaking changes for the serde
representation of some types.
Serialization of `Value`s used to rely on the `get` function
followed by an `unwrap`. This means that optional types couldn't
be serialized when they were `None`.
This commit distinguishes between the optional `Value` `Types` and
the ones that always return some value.
The `Value`s, `Structure` fields and `Tag`s with following types are
now represented as `Option`s:
- `Buffer`
- `DateTime`
- `Sample` (note: this type is used for `Tag` images)
- `String` (except for `Tag`s - see the comment in `tags_serde.rs`).
The representations for these `Type`s remain unchanged when they are
used in-place (not as part of a `Value`).
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/issues/215