gstreamer: meta: Add some more AsRef and AsMut impls

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1331>
This commit is contained in:
Sebastian Dröge 2023-10-26 13:38:07 +03:00
parent 4d19d7b0b6
commit d5ba6c1336

View file

@ -135,6 +135,13 @@ impl<'a, T> AsRef<MetaRef<'a, T>> for MetaRef<'a, T> {
}
}
impl<'a, T> AsRef<T> for MetaRef<'a, T> {
#[inline]
fn as_ref(&self) -> &T {
self.meta
}
}
impl<'a, T, U> ops::Deref for MetaRefMut<'a, T, U> {
type Target = T;
@ -158,6 +165,13 @@ impl<'a, T, U> AsRef<MetaRef<'a, T>> for MetaRefMut<'a, T, U> {
}
}
impl<'a, T, U> AsMut<T> for MetaRefMut<'a, T, U> {
#[inline]
fn as_mut(&mut self) -> &mut T {
self.meta
}
}
impl<'a, T> MetaRef<'a, T> {
#[doc(alias = "get_api")]
#[inline]