gstreamer: Implement Deref<Target=[glib::SendValue]> for List and Array

This commit is contained in:
Sebastian Dröge 2021-10-12 11:24:54 +03:00
parent 37c3d2d8e0
commit 8fb37c5134

View file

@ -655,6 +655,14 @@ impl<'a> Array<'a> {
} }
} }
impl<'a> ops::Deref for Array<'a> {
type Target = [glib::SendValue];
fn deref(&self) -> &[glib::SendValue] {
self.as_slice()
}
}
impl<'a> From<&'a [&'a (dyn ToSendValue + Sync)]> for Array<'a> { impl<'a> From<&'a [&'a (dyn ToSendValue + Sync)]> for Array<'a> {
fn from(values: &'a [&'a (dyn ToSendValue + Sync)]) -> Self { fn from(values: &'a [&'a (dyn ToSendValue + Sync)]) -> Self {
skip_assert_initialized!(); skip_assert_initialized!();
@ -749,6 +757,14 @@ impl<'a> List<'a> {
} }
} }
impl<'a> ops::Deref for List<'a> {
type Target = [glib::SendValue];
fn deref(&self) -> &[glib::SendValue] {
self.as_slice()
}
}
impl<'a> From<&'a [&'a (dyn ToSendValue + Sync)]> for List<'a> { impl<'a> From<&'a [&'a (dyn ToSendValue + Sync)]> for List<'a> {
fn from(values: &'a [&'a (dyn ToSendValue + Sync)]) -> Self { fn from(values: &'a [&'a (dyn ToSendValue + Sync)]) -> Self {
skip_assert_initialized!(); skip_assert_initialized!();