gstreamer: meta: Add some more AsRef and AsMut impls

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

View file

@ -143,6 +143,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;
@ -166,6 +173,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]