gst/format: module directory + ops fixes & additions
This MR introduces a directory module for the format related concepts and shuffles these concepts in subdirectories in order to help with readability and maintenance.
A new module level documentation aims at helping users understand format usage and discover available APIs and operations.
Writing the documentation and checking the generated pages helped me discover shortcomings.
Some operations were implemented on types that wouldn't result in the expected physical unit. E.g.:
-
ClockTime / ClockTime
results in a unit-less factor. -
u64 / ClockTime
would result in a1 / ClockTime
. Since we don't use anyFrequency
type, this operation is removed. Users should use theClockTime
accessors to compute the expected value.
This commit also adds:
- multiplications with integers as the left hand side operands.
-
Partial{Eq,Ord}
forSigned<T>
withT
as left hand side operand. -
opt_add
/opt_sub
forSigned<T>
withT
as left or right hand side operands. - missing tests for
Partial{Eq,Ord}
andOptionOrd
.
This implementation can interfere with unrelated code and was removed:
-
Signed<usize>.
PartialOrd
makes existing code computing the len of slices needing type annotation because the len is later used in a comparison for which the compiler is unable to determine if the len isSigned<usize>
orusize
.
Non-regression on gst-plugins-rs
checked in this branch.