gstreamer-rs/gstreamer-video/src
François Laignel ea25c9262b Add field_if_some setter for builders
This commit adds `_if_some()` variants for builder field setters.
The variants aim at improving usability when setting optional fields.
E.g. currently, we need to write something like:

```rust
let opt_value = ...;
let mut sb = gst::Structure::builder("test")
    .field("mandatory_field", "mandatory");

if let Some(value) = opt_value
    sb = sb.field("optional_field", value);
}

let s = sb.build();
```

With `_if_some()`, this can be written like this:

```rust
let opt_value = ...;
let s = gst::Structure::builder("test")
    .field("mandatory_field", "mandatory")
    .field_if_some("optional_field", opt_value)
    .build();
```

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1424>
2024-04-17 17:15:39 +02:00
..
auto Regenerate with latest gir / gir files 2024-03-19 09:57:38 +02:00
subclass Simplify various raw pointer casts everywhere 2023-11-29 11:24:47 +02:00
caps.rs Add field_if_some setter for builders 2024-04-17 17:15:39 +02:00
caps_features.rs Switch from once_cell to std::sync::OnceLock where it makes sense 2024-01-31 14:59:54 +02:00
color_balance_channel.rs Group and merge imports in all manual code 2023-01-04 13:25:17 +02:00
enums.rs Remove dox feature and replace by docsrs configuration 2023-05-04 09:19:29 +03:00
flag_serde.rs Adapt to no longer re-exported traits 2024-02-03 10:48:37 +01:00
functions.rs Remove dox feature and replace by docsrs configuration 2023-05-04 09:19:29 +03:00
lib.rs Add accessors for various base class fields 2024-01-05 15:56:19 +02:00
utils.rs Migrate everything to object lock API instead of custom GMutex handling 2023-02-06 10:50:33 +02:00
video_aggregator.rs Adapt to no longer re-exported traits 2024-02-03 10:48:37 +01:00
video_aggregator_convert_pad.rs Adapt to no longer re-exported traits 2024-02-03 10:48:37 +01:00
video_aggregator_pad.rs Seal manual traits 2023-07-06 14:21:45 +03:00
video_buffer_pool.rs Simplify various raw pointer casts everywhere 2023-11-29 11:24:47 +02:00
video_codec_frame.rs Remove dox feature and replace by docsrs configuration 2023-05-04 09:19:29 +03:00
video_codec_state.rs Simplify various raw pointer casts everywhere 2023-11-29 11:24:47 +02:00
video_color_matrix.rs manual code: fix-getters-def doc aliases 2021-05-03 20:46:57 +02:00
video_converter.rs audio: Implement From/ToValue in Audio/VideoConverterConfig 2024-03-22 17:16:48 +00:00
video_decoder.rs Add accessors for various base class fields 2024-01-05 15:56:19 +02:00
video_encoder.rs Add accessors for various base class fields 2024-01-05 15:56:19 +02:00
video_event.rs Add field_if_some setter for builders 2024-04-17 17:15:39 +02:00
video_filter.rs Add accessors for various base class fields 2024-01-05 15:56:19 +02:00
video_format.rs Switch from once_cell to std::sync::OnceLock where it makes sense 2024-01-31 14:59:54 +02:00
video_format_info.rs video: Fix ordering of video formats according to latest libgstvideo 2023-10-02 19:39:46 +03:00
video_frame.rs Remove &mut BufferRef getter from write-mapped AudioBuffer / VideoFrame 2024-01-05 22:27:07 +02:00
video_hdr.rs Change some assertions to debug assertions 2023-01-14 17:13:46 +02:00
video_info.rs Add field_if_some setter for builders 2024-04-17 17:15:39 +02:00
video_info_dma_drm.rs video: Add conversions between VideoInfo and VideoInfoDmaDrm 2023-07-06 08:46:06 +03:00
video_message.rs Add field_if_some setter for builders 2024-04-17 17:15:39 +02:00
video_meta.rs video_meta: Rename transformation to scale 2024-03-19 14:44:57 +00:00
video_overlay.rs Seal manual traits 2023-07-06 14:21:45 +03:00
video_overlay_composition.rs Remove dox feature and replace by docsrs configuration 2023-05-04 09:19:29 +03:00
video_rectangle.rs Inline various trivial functions 2023-01-11 11:33:54 +02:00
video_time_code.rs Fix various new 1.73 clippy warnings 2023-10-03 17:44:12 +03:00
video_time_code_interval.rs Use uninitialized stack memory for out parameters instead of zeroed memory if applicable 2023-01-11 09:06:38 +00:00
video_vbi.rs gst-video: bindings for VideoVBIEncoder & VideoVBIParser 2023-10-09 18:21:16 +00:00
video_vbi_encoder.rs video: fix visibility for VideoVBIEncoder::try_new 2023-10-11 17:53:43 +02:00
video_vbi_parser.rs gst-video: bindings for VideoVBIEncoder & VideoVBIParser 2023-10-09 18:21:16 +00:00