gstreamer-rs/gstreamer/src/format
François Laignel dcf6d16496 gst/format: new panicking constructors and some Percent fixes
Previous proposition for constructing specific formatted values was
to use an operation such as `42 * Default::ONE` which, in retrospect,
doesn't seem idiomatic.

This commit adds `from_u64` and `from_usize` constructors for most
formatted values. Having `from_usize` is convenient when dealing with
quantities related to containers indices or length.

This also fixes the `Percent` from float constructors from which was
derived the `ONE` constant as well as previous display implementation.

Also removed the `pub` specifier for `Undefined` inner value. It wasn't
removed in a previous commit as `Undefined` can use the full range of
the inner type. But now, it seems preferable not to expose the inner
value for proper encapsulation and so as to reduce the differences with
other formatted values (kind of least astonishment principle).
2022-10-11 13:25:53 +02:00
..
clock_time.rs format/specific: don't expose inner as pub 2022-10-10 19:23:35 +02:00
clock_time_serde.rs format/specific: don't expose inner as pub 2022-10-10 19:23:35 +02:00
compatible.rs gst/lib: cleanup format re-exports 2022-10-10 15:10:10 +02:00
format_serde.rs gst/format: new panicking constructors and some Percent fixes 2022-10-11 13:25:53 +02:00
generic.rs gst/format: new panicking constructors and some Percent fixes 2022-10-11 13:25:53 +02:00
macros.rs gst/format: new panicking constructors and some Percent fixes 2022-10-11 13:25:53 +02:00
mod.rs gst/format: new panicking constructors and some Percent fixes 2022-10-11 13:25:53 +02:00
signed.rs format/Other: use u64 internally instead of i64 2022-10-09 20:00:38 +02:00
specific.rs gst/format: new panicking constructors and some Percent fixes 2022-10-11 13:25:53 +02:00
undefined.rs gst/format: new panicking constructors and some Percent fixes 2022-10-11 13:25:53 +02:00