forked from mirrors/gstreamer-rs
ea25c9262b
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> |
||
---|---|---|
.. | ||
auto | ||
subclass | ||
flag_serde.rs | ||
lib.rs | ||
rtsp_address_pool.rs | ||
rtsp_auth.rs | ||
rtsp_client.rs | ||
rtsp_context.rs | ||
rtsp_media.rs | ||
rtsp_media_factory.rs | ||
rtsp_onvif_media_factory.rs | ||
rtsp_server.rs | ||
rtsp_session.rs | ||
rtsp_session_pool.rs | ||
rtsp_thread.rs | ||
rtsp_token.rs |