Fix nightly warnings about confusing lifetime flow

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1746>
This commit is contained in:
Sebastian Dröge 2025-06-30 13:17:38 +03:00
parent fe66ed71a1
commit 04c524a20b
48 changed files with 145 additions and 141 deletions

View file

@ -27,7 +27,7 @@ mod custom_meta {
pub fn add(
buffer: &mut gst::BufferRef,
label: String,
) -> gst::MetaRefMut<Self, gst::meta::Standalone> {
) -> gst::MetaRefMut<'_, Self, gst::meta::Standalone> {
unsafe {
// Manually dropping because gst_buffer_add_meta() takes ownership of the
// content of the struct.

View file

@ -17,13 +17,13 @@ pub trait AnalyticsRelationMetaClassificationExt: sealed::Sealed {
&mut self,
confidence_level: f32,
class_quark: glib::Quark,
) -> Result<AnalyticsMtdRef<AnalyticsClassificationMtd>, glib::BoolError>;
) -> Result<AnalyticsMtdRef<'_, AnalyticsClassificationMtd>, glib::BoolError>;
fn add_cls_mtd(
&mut self,
confidence_levels: &[f32],
class_quarks: &[glib::Quark],
) -> Result<AnalyticsMtdRef<AnalyticsClassificationMtd>, glib::BoolError>;
) -> Result<AnalyticsMtdRef<'_, AnalyticsClassificationMtd>, glib::BoolError>;
}
impl<'a> AnalyticsRelationMetaClassificationExt
@ -124,7 +124,7 @@ impl AnalyticsMtdRef<'_, AnalyticsClassificationMtd> {
}
}
pub fn iterate(&self) -> AnalyticsClassificationIterator {
pub fn iterate(&self) -> AnalyticsClassificationIterator<'_> {
AnalyticsClassificationIterator {
mtd: self,
index: 0,

View file

@ -21,7 +21,7 @@ pub trait AnalyticsRelationMetaODExt: sealed::Sealed {
w: i32,
h: i32,
loc_conf_lvl: f32,
) -> Result<AnalyticsMtdRef<AnalyticsODMtd>, glib::BoolError>;
) -> Result<AnalyticsMtdRef<'_, AnalyticsODMtd>, glib::BoolError>;
#[cfg(feature = "v1_26")]
#[allow(clippy::too_many_arguments)]
@ -34,7 +34,7 @@ pub trait AnalyticsRelationMetaODExt: sealed::Sealed {
h: i32,
r: f32,
loc_conf_lvl: f32,
) -> Result<AnalyticsMtdRef<AnalyticsODMtd>, glib::BoolError>;
) -> Result<AnalyticsMtdRef<'_, AnalyticsODMtd>, glib::BoolError>;
}
impl AnalyticsRelationMetaODExt
@ -49,7 +49,7 @@ impl AnalyticsRelationMetaODExt
w: i32,
h: i32,
loc_conf_lvl: f32,
) -> Result<AnalyticsMtdRef<AnalyticsODMtd>, glib::BoolError> {
) -> Result<AnalyticsMtdRef<'_, AnalyticsODMtd>, glib::BoolError> {
unsafe {
let mut mtd = std::mem::MaybeUninit::uninit();
let ret = from_glib(ffi::gst_analytics_relation_meta_add_od_mtd(
@ -84,7 +84,7 @@ impl AnalyticsRelationMetaODExt
h: i32,
r: f32,
loc_conf_lvl: f32,
) -> Result<AnalyticsMtdRef<AnalyticsODMtd>, glib::BoolError> {
) -> Result<AnalyticsMtdRef<'_, AnalyticsODMtd>, glib::BoolError> {
unsafe {
let mut mtd = std::mem::MaybeUninit::uninit();
let ret = from_glib(ffi::gst_analytics_relation_meta_add_oriented_od_mtd(

View file

@ -64,7 +64,7 @@ impl std::fmt::Debug for AnalyticsRelationMeta {
impl AnalyticsRelationMeta {
#[doc(alias = "gst_buffer_add_analytics_relation_meta")]
pub fn add(buffer: &mut gst::BufferRef) -> gst::MetaRefMut<Self, gst::meta::Standalone> {
pub fn add(buffer: &mut gst::BufferRef) -> gst::MetaRefMut<'_, Self, gst::meta::Standalone> {
skip_assert_initialized!();
unsafe {

View file

@ -15,7 +15,7 @@ unsafe impl Sync for TensorMeta {}
impl TensorMeta {
#[doc(alias = "gst_buffer_add_tensor_meta")]
pub fn add(buffer: &mut gst::BufferRef) -> gst::MetaRefMut<Self, gst::meta::Standalone> {
pub fn add(buffer: &mut gst::BufferRef) -> gst::MetaRefMut<'_, Self, gst::meta::Standalone> {
skip_assert_initialized!();
unsafe {

View file

@ -17,7 +17,7 @@ pub trait AnalyticsRelationMetaTrackingExt: sealed::Sealed {
&mut self,
tracking_id: u64,
tracking_first_seen: gst::ClockTime,
) -> Result<AnalyticsMtdRef<AnalyticsTrackingMtd>, glib::BoolError>;
) -> Result<AnalyticsMtdRef<'_, AnalyticsTrackingMtd>, glib::BoolError>;
}
impl AnalyticsRelationMetaTrackingExt
@ -28,7 +28,7 @@ impl AnalyticsRelationMetaTrackingExt
&mut self,
tracking_id: u64,
tracking_first_seen: gst::ClockTime,
) -> Result<AnalyticsMtdRef<AnalyticsTrackingMtd>, glib::BoolError> {
) -> Result<AnalyticsMtdRef<'_, AnalyticsTrackingMtd>, glib::BoolError> {
unsafe {
let mut mtd = std::mem::MaybeUninit::uninit();
let ret = from_glib(ffi::gst_analytics_relation_meta_add_tracking_mtd(

View file

@ -26,7 +26,7 @@ impl AudioClippingMeta {
buffer: &mut gst::BufferRef,
start: V,
end: V,
) -> gst::MetaRefMut<Self, gst::meta::Standalone> {
) -> gst::MetaRefMut<'_, Self, gst::meta::Standalone> {
skip_assert_initialized!();
assert_eq!(start.format(), end.format());
unsafe {
@ -244,7 +244,7 @@ impl AudioLevelMeta {
buffer: &mut gst::BufferRef,
level: u8,
voice_activity: bool,
) -> gst::MetaRefMut<Self, gst::meta::Standalone> {
) -> gst::MetaRefMut<'_, Self, gst::meta::Standalone> {
skip_assert_initialized!();
unsafe {
let meta = ffi::gst_buffer_add_audio_level_meta(

View file

@ -398,7 +398,7 @@ impl UniqueAdapter {
}
#[doc(alias = "gst_adapter_map")]
pub fn map(&mut self, nbytes: usize) -> Result<UniqueAdapterMap, glib::error::BoolError> {
pub fn map(&mut self, nbytes: usize) -> Result<UniqueAdapterMap<'_>, glib::error::BoolError> {
assert!(nbytes <= self.available());
assert!(nbytes != 0);

View file

@ -754,7 +754,7 @@ impl Harness {
}
#[doc(alias = "get_sink_harness")]
pub fn sink_harness(&self) -> Option<Ref> {
pub fn sink_harness(&self) -> Option<Ref<'_>> {
unsafe {
if (*self.0.as_ptr()).sink_harness.is_null() {
None
@ -768,7 +768,7 @@ impl Harness {
}
#[doc(alias = "get_src_harness")]
pub fn src_harness(&self) -> Option<Ref> {
pub fn src_harness(&self) -> Option<Ref<'_>> {
unsafe {
if (*self.0.as_ptr()).src_harness.is_null() {
None
@ -782,7 +782,7 @@ impl Harness {
}
#[doc(alias = "get_mut_sink_harness")]
pub fn sink_harness_mut(&mut self) -> Option<RefMut> {
pub fn sink_harness_mut(&mut self) -> Option<RefMut<'_>> {
unsafe {
if (*self.0.as_ptr()).sink_harness.is_null() {
None
@ -796,7 +796,7 @@ impl Harness {
}
#[doc(alias = "get_mut_src_harness")]
pub fn src_harness_mut(&mut self) -> Option<RefMut> {
pub fn src_harness_mut(&mut self) -> Option<RefMut<'_>> {
unsafe {
if (*self.0.as_ptr()).src_harness.is_null() {
None

View file

@ -142,7 +142,8 @@ mod tests {
alpha: f64,
zorder: u32,
operator: i32,
) -> Result<gst::MetaRefMut<FrameCompositionMeta, gst::meta::Standalone>, glib::BoolError> {
) -> Result<gst::MetaRefMut<'_, FrameCompositionMeta, gst::meta::Standalone>, glib::BoolError>
{
assert_initialized_main_thread!();
unsafe {

View file

@ -116,7 +116,7 @@ impl fmt::Debug for DebugInfo<'_> {
}
impl DiscovererInfo {
pub fn debug(&self) -> DebugInfo {
pub fn debug(&self) -> DebugInfo<'_> {
DebugInfo(self)
}
}

View file

@ -26,7 +26,7 @@ impl fmt::Debug for Debug<'_> {
}
impl DiscovererAudioInfo {
pub fn debug(&self) -> Debug {
pub fn debug(&self) -> Debug<'_> {
Debug(self)
}
}

View file

@ -26,7 +26,7 @@ impl fmt::Debug for Debug<'_> {
}
impl DiscovererContainerInfo {
pub fn debug(&self) -> Debug {
pub fn debug(&self) -> Debug<'_> {
Debug(self)
}
}

View file

@ -70,7 +70,7 @@ impl fmt::Debug for Debug<'_> {
}
impl DiscovererStreamInfo {
pub fn debug(&self) -> Debug {
pub fn debug(&self) -> Debug<'_> {
Debug(self)
}
}

View file

@ -20,7 +20,7 @@ impl fmt::Debug for Debug<'_> {
}
impl DiscovererSubtitleInfo {
pub fn debug(&self) -> Debug {
pub fn debug(&self) -> Debug<'_> {
Debug(self)
}
}

View file

@ -31,7 +31,7 @@ impl DiscovererVideoInfo {
}
}
pub fn debug(&self) -> Debug {
pub fn debug(&self) -> Debug<'_> {
Debug(self)
}
}

View file

@ -193,7 +193,7 @@ impl EncodingAudioProfile {
}
#[doc(alias = "gst_encoding_audio_profile_new")]
pub fn builder(format: &gst::Caps) -> EncodingAudioProfileBuilder {
pub fn builder(format: &gst::Caps) -> EncodingAudioProfileBuilder<'_> {
assert_initialized_main_thread!();
EncodingAudioProfileBuilder::new(format)
}
@ -223,7 +223,7 @@ impl EncodingVideoProfile {
}
#[doc(alias = "gst_encoding_video_profile_new")]
pub fn builder(format: &gst::Caps) -> EncodingVideoProfileBuilder {
pub fn builder(format: &gst::Caps) -> EncodingVideoProfileBuilder<'_> {
assert_initialized_main_thread!();
EncodingVideoProfileBuilder::new(format)
}
@ -271,7 +271,7 @@ impl EncodingContainerProfile {
}
#[doc(alias = "gst_encoding_container_profile_new")]
pub fn builder(format: &gst::Caps) -> EncodingContainerProfileBuilder {
pub fn builder(format: &gst::Caps) -> EncodingContainerProfileBuilder<'_> {
assert_initialized_main_thread!();
EncodingContainerProfileBuilder::new(format)
}

View file

@ -651,7 +651,7 @@ impl PlayMessage<'_> {
#[doc(alias = "gst_play_message_parse_muted_changed")]
#[doc(alias = "gst_play_message_parse_volume_changed")]
#[doc(alias = "gst_play_message_parse_seek_done")]
pub fn parse(msg: &gst::Message) -> Result<PlayMessage, glib::error::BoolError> {
pub fn parse(msg: &gst::Message) -> Result<PlayMessage<'_>, glib::error::BoolError> {
skip_assert_initialized!();
if !Play::is_play_message(msg) {

View file

@ -176,19 +176,19 @@ impl SDPMediaRef {
}
}
pub fn attributes(&self) -> AttributesIter {
pub fn attributes(&self) -> AttributesIter<'_> {
AttributesIter::new(self)
}
pub fn formats(&self) -> FormatsIter {
pub fn formats(&self) -> FormatsIter<'_> {
FormatsIter::new(self)
}
pub fn bandwidths(&self) -> BandwidthsIter {
pub fn bandwidths(&self) -> BandwidthsIter<'_> {
BandwidthsIter::new(self)
}
pub fn connections(&self) -> ConnectionsIter {
pub fn connections(&self) -> ConnectionsIter<'_> {
ConnectionsIter::new(self)
}

View file

@ -901,35 +901,35 @@ impl SDPMessageRef {
}
}
pub fn attributes(&self) -> AttributesIter {
pub fn attributes(&self) -> AttributesIter<'_> {
AttributesIter::new(self)
}
pub fn bandwidths(&self) -> BandwidthsIter {
pub fn bandwidths(&self) -> BandwidthsIter<'_> {
BandwidthsIter::new(self)
}
pub fn emails(&self) -> EmailsIter {
pub fn emails(&self) -> EmailsIter<'_> {
EmailsIter::new(self)
}
pub fn medias(&self) -> MediasIter {
pub fn medias(&self) -> MediasIter<'_> {
MediasIter::new(self)
}
pub fn medias_mut(&mut self) -> MediasIterMut {
pub fn medias_mut(&mut self) -> MediasIterMut<'_> {
MediasIterMut::new(self)
}
pub fn phones(&self) -> PhonesIter {
pub fn phones(&self) -> PhonesIter<'_> {
PhonesIter::new(self)
}
pub fn times(&self) -> TimesIter {
pub fn times(&self) -> TimesIter<'_> {
TimesIter::new(self)
}
pub fn zones(&self) -> ZonesIter {
pub fn zones(&self) -> ZonesIter<'_> {
ZonesIter::new(self)
}
}

View file

@ -47,7 +47,7 @@ pub trait VideoDecoderExtManual: IsA<VideoDecoder> + 'static {
#[doc(alias = "get_frame")]
#[doc(alias = "gst_video_decoder_get_frame")]
fn frame(&self, frame_number: i32) -> Option<VideoCodecFrame> {
fn frame(&self, frame_number: i32) -> Option<VideoCodecFrame<'_>> {
let frame = unsafe {
ffi::gst_video_decoder_get_frame(self.as_ref().to_glib_none().0, frame_number)
};
@ -61,7 +61,7 @@ pub trait VideoDecoderExtManual: IsA<VideoDecoder> + 'static {
#[doc(alias = "get_frames")]
#[doc(alias = "gst_video_decoder_get_frames")]
fn frames(&self) -> Vec<VideoCodecFrame> {
fn frames(&self) -> Vec<VideoCodecFrame<'_>> {
unsafe {
let frames = ffi::gst_video_decoder_get_frames(self.as_ref().to_glib_none().0);
let mut iter: *const glib::ffi::GList = frames;
@ -82,7 +82,7 @@ pub trait VideoDecoderExtManual: IsA<VideoDecoder> + 'static {
#[doc(alias = "get_oldest_frame")]
#[doc(alias = "gst_video_decoder_get_oldest_frame")]
fn oldest_frame(&self) -> Option<VideoCodecFrame> {
fn oldest_frame(&self) -> Option<VideoCodecFrame<'_>> {
let frame =
unsafe { ffi::gst_video_decoder_get_oldest_frame(self.as_ref().to_glib_none().0) };
@ -162,7 +162,7 @@ pub trait VideoDecoderExtManual: IsA<VideoDecoder> + 'static {
width: u32,
height: u32,
reference: Option<&VideoCodecState<Readable>>,
) -> Result<VideoCodecState<InNegotiation>, gst::FlowError> {
) -> Result<VideoCodecState<'_, InNegotiation<'_>>, gst::FlowError> {
let state = unsafe {
let reference = match reference {
Some(reference) => reference.as_mut_ptr(),
@ -194,7 +194,7 @@ pub trait VideoDecoderExtManual: IsA<VideoDecoder> + 'static {
width: u32,
height: u32,
reference: Option<&VideoCodecState<Readable>>,
) -> Result<VideoCodecState<InNegotiation>, gst::FlowError> {
) -> Result<VideoCodecState<'_, InNegotiation<'_>>, gst::FlowError> {
let state = unsafe {
let reference = match reference {
Some(reference) => reference.as_mut_ptr(),

View file

@ -29,7 +29,7 @@ pub trait VideoEncoderExtManual: IsA<VideoEncoder> + 'static {
#[doc(alias = "get_frame")]
#[doc(alias = "gst_video_encoder_get_frame")]
fn frame(&self, frame_number: i32) -> Option<VideoCodecFrame> {
fn frame(&self, frame_number: i32) -> Option<VideoCodecFrame<'_>> {
let frame = unsafe {
ffi::gst_video_encoder_get_frame(self.as_ref().to_glib_none().0, frame_number)
};
@ -43,7 +43,7 @@ pub trait VideoEncoderExtManual: IsA<VideoEncoder> + 'static {
#[doc(alias = "get_frames")]
#[doc(alias = "gst_video_encoder_get_frames")]
fn frames(&self) -> Vec<VideoCodecFrame> {
fn frames(&self) -> Vec<VideoCodecFrame<'_>> {
unsafe {
let frames = ffi::gst_video_encoder_get_frames(self.as_ref().to_glib_none().0);
let mut iter: *const glib::ffi::GList = frames;
@ -64,7 +64,7 @@ pub trait VideoEncoderExtManual: IsA<VideoEncoder> + 'static {
#[doc(alias = "get_oldest_frame")]
#[doc(alias = "gst_video_encoder_get_oldest_frame")]
fn oldest_frame(&self) -> Option<VideoCodecFrame> {
fn oldest_frame(&self) -> Option<VideoCodecFrame<'_>> {
let frame =
unsafe { ffi::gst_video_encoder_get_oldest_frame(self.as_ref().to_glib_none().0) };
@ -154,7 +154,7 @@ pub trait VideoEncoderExtManual: IsA<VideoEncoder> + 'static {
&self,
caps: gst::Caps,
reference: Option<&VideoCodecState<Readable>>,
) -> Result<VideoCodecState<InNegotiation>, gst::FlowError> {
) -> Result<VideoCodecState<'_, InNegotiation<'_>>, gst::FlowError> {
let state = unsafe {
let reference = match reference {
Some(reference) => reference.as_mut_ptr(),

View file

@ -1021,12 +1021,12 @@ impl NavigationEvent {
modifier_state: NavigationModifierType::empty(),
}
}
pub fn key_press_builder(key: &str) -> KeyEventBuilder {
pub fn key_press_builder(key: &str) -> KeyEventBuilder<'_> {
assert_initialized_main_thread!();
KeyEventBuilder::new(KeyEventType::Press { key })
}
pub fn key_release_builder(key: &str) -> KeyEventBuilder {
pub fn key_release_builder(key: &str) -> KeyEventBuilder<'_> {
assert_initialized_main_thread!();
KeyEventBuilder::new(KeyEventType::Release { key })
}

View file

@ -21,7 +21,7 @@ impl VideoMeta {
format: crate::VideoFormat,
width: u32,
height: u32,
) -> Result<gst::MetaRefMut<Self, gst::meta::Standalone>, glib::BoolError> {
) -> Result<gst::MetaRefMut<'_, Self, gst::meta::Standalone>, glib::BoolError> {
skip_assert_initialized!();
if format == crate::VideoFormat::Unknown || format == crate::VideoFormat::Encoded {
@ -268,7 +268,7 @@ impl VideoCropMeta {
pub fn add(
buffer: &mut gst::BufferRef,
rect: (u32, u32, u32, u32),
) -> gst::MetaRefMut<Self, gst::meta::Standalone> {
) -> gst::MetaRefMut<'_, Self, gst::meta::Standalone> {
skip_assert_initialized!();
unsafe {
let meta = gst::ffi::gst_buffer_add_meta(
@ -376,7 +376,7 @@ impl VideoRegionOfInterestMeta {
}
#[doc(alias = "get_params")]
pub fn params(&self) -> ParamsIter {
pub fn params(&self) -> ParamsIter<'_> {
ParamsIter {
_meta: self,
list: ptr::NonNull::new(self.0.params),
@ -703,7 +703,7 @@ impl VideoAFDMeta {
field: u8,
spec: crate::VideoAFDSpec,
afd: crate::VideoAFDValue,
) -> gst::MetaRefMut<Self, gst::meta::Standalone> {
) -> gst::MetaRefMut<'_, Self, gst::meta::Standalone> {
skip_assert_initialized!();
unsafe {
@ -784,7 +784,7 @@ impl VideoBarMeta {
is_letterbox: bool,
bar_data1: u32,
bar_data2: u32,
) -> gst::MetaRefMut<Self, gst::meta::Standalone> {
) -> gst::MetaRefMut<'_, Self, gst::meta::Standalone> {
skip_assert_initialized!();
unsafe {
@ -869,7 +869,7 @@ impl VideoCodecAlphaMeta {
pub fn add(
buffer: &mut gst::BufferRef,
alpha_buffer: gst::Buffer,
) -> gst::MetaRefMut<Self, gst::meta::Standalone> {
) -> gst::MetaRefMut<'_, Self, gst::meta::Standalone> {
skip_assert_initialized!();
unsafe {
let meta = ffi::gst_buffer_add_video_codec_alpha_meta(
@ -1016,7 +1016,7 @@ unsafe impl Sync for AncillaryMeta {}
#[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
impl AncillaryMeta {
#[doc(alias = "gst_buffer_add_ancillary_meta")]
pub fn add(buffer: &mut gst::BufferRef) -> gst::MetaRefMut<Self, gst::meta::Standalone> {
pub fn add(buffer: &mut gst::BufferRef) -> gst::MetaRefMut<'_, Self, gst::meta::Standalone> {
skip_assert_initialized!();
unsafe {
let meta = ffi::gst_buffer_add_ancillary_meta(buffer.as_mut_ptr());

View file

@ -324,7 +324,7 @@ impl VideoOverlayCompositionRef {
}
}
pub fn iter(&self) -> Iter {
pub fn iter(&self) -> Iter<'_> {
Iter {
composition: self,
idx: 0,

View file

@ -115,7 +115,7 @@ impl VideoVBIParser {
Ok(())
}
pub fn iter(&mut self) -> AncillaryIter {
pub fn iter(&mut self) -> AncillaryIter<'_> {
AncillaryIter { parser: self }
}

View file

@ -170,7 +170,7 @@ impl Default for Buffer {
impl BufferRef {
#[doc(alias = "gst_buffer_map")]
#[inline]
pub fn map_readable(&self) -> Result<BufferMap<Readable>, glib::BoolError> {
pub fn map_readable(&self) -> Result<BufferMap<'_, Readable>, glib::BoolError> {
unsafe {
let mut map_info = mem::MaybeUninit::uninit();
let res =
@ -189,7 +189,7 @@ impl BufferRef {
#[doc(alias = "gst_buffer_map")]
#[inline]
pub fn map_writable(&mut self) -> Result<BufferMap<Writable>, glib::BoolError> {
pub fn map_writable(&mut self) -> Result<BufferMap<'_, Writable>, glib::BoolError> {
unsafe {
let mut map_info = mem::MaybeUninit::uninit();
let res = ffi::gst_buffer_map(
@ -251,7 +251,7 @@ impl BufferRef {
pub fn map_range_readable(
&self,
range: impl RangeBounds<usize>,
) -> Result<BufferMap<Readable>, glib::BoolError> {
) -> Result<BufferMap<'_, Readable>, glib::BoolError> {
let (idx, len) = self.memory_range_into_idx_len(range)?;
unsafe {
let mut map_info = mem::MaybeUninit::uninit();
@ -279,7 +279,7 @@ impl BufferRef {
pub fn map_range_writable(
&mut self,
range: impl RangeBounds<usize>,
) -> Result<BufferMap<Writable>, glib::BoolError> {
) -> Result<BufferMap<'_, Writable>, glib::BoolError> {
let (idx, len) = self.memory_range_into_idx_len(range)?;
unsafe {
let mut map_info = mem::MaybeUninit::uninit();
@ -553,7 +553,7 @@ impl BufferRef {
#[doc(alias = "get_meta")]
#[doc(alias = "gst_buffer_get_meta")]
#[inline]
pub fn meta<T: MetaAPI>(&self) -> Option<MetaRef<T>> {
pub fn meta<T: MetaAPI>(&self) -> Option<MetaRef<'_, T>> {
unsafe {
let meta = ffi::gst_buffer_get_meta(self.as_mut_ptr(), T::meta_api().into_glib());
if meta.is_null() {
@ -566,7 +566,7 @@ impl BufferRef {
#[doc(alias = "get_meta_mut")]
#[inline]
pub fn meta_mut<T: MetaAPI>(&mut self) -> Option<MetaRefMut<T, crate::meta::Standalone>> {
pub fn meta_mut<T: MetaAPI>(&mut self) -> Option<MetaRefMut<'_, T, crate::meta::Standalone>> {
unsafe {
let meta = ffi::gst_buffer_get_meta(self.as_mut_ptr(), T::meta_api().into_glib());
if meta.is_null() {
@ -577,11 +577,11 @@ impl BufferRef {
}
}
pub fn iter_meta<T: MetaAPI>(&self) -> MetaIter<T> {
pub fn iter_meta<T: MetaAPI>(&self) -> MetaIter<'_, T> {
MetaIter::new(self)
}
pub fn iter_meta_mut<T: MetaAPI>(&mut self) -> MetaIterMut<T> {
pub fn iter_meta_mut<T: MetaAPI>(&mut self) -> MetaIterMut<'_, T> {
MetaIterMut::new(self)
}
@ -826,11 +826,11 @@ impl BufferRef {
}
}
pub fn iter_memories(&self) -> Iter {
pub fn iter_memories(&self) -> Iter<'_> {
Iter::new(self)
}
pub fn iter_memories_mut(&mut self) -> Result<IterMut, glib::BoolError> {
pub fn iter_memories_mut(&mut self) -> Result<IterMut<'_>, glib::BoolError> {
if !self.is_all_memory_writable() {
Err(glib::bool_error!("Not all memory are writable"))
} else {
@ -838,7 +838,7 @@ impl BufferRef {
}
}
pub fn iter_memories_owned(&self) -> IterOwned {
pub fn iter_memories_owned(&self) -> IterOwned<'_> {
IterOwned::new(self)
}
@ -853,7 +853,7 @@ impl BufferRef {
}
#[doc(alias = "gst_util_dump_buffer")]
pub fn dump(&self) -> Dump {
pub fn dump(&self) -> Dump<'_> {
Dump {
buffer: self,
start: Bound::Unbounded,
@ -862,7 +862,7 @@ impl BufferRef {
}
#[doc(alias = "gst_util_dump_buffer")]
pub fn dump_range(&self, range: impl RangeBounds<usize>) -> Dump {
pub fn dump_range(&self, range: impl RangeBounds<usize>) -> Dump<'_> {
Dump {
buffer: self,
start: range.start_bound().cloned(),

View file

@ -133,11 +133,11 @@ impl BufferListRef {
self.len() == 0
}
pub fn iter(&self) -> Iter {
pub fn iter(&self) -> Iter<'_> {
Iter::new(self)
}
pub fn iter_owned(&self) -> IterOwned {
pub fn iter_owned(&self) -> IterOwned<'_> {
IterOwned::new(self)
}

View file

@ -251,12 +251,12 @@ impl Bus {
}
#[doc(alias = "gst_bus_pop")]
pub fn iter(&self) -> Iter {
pub fn iter(&self) -> Iter<'_> {
self.iter_timed(Some(crate::ClockTime::ZERO))
}
#[doc(alias = "gst_bus_timed_pop")]
pub fn iter_timed(&self, timeout: impl Into<Option<crate::ClockTime>>) -> Iter {
pub fn iter_timed(&self, timeout: impl Into<Option<crate::ClockTime>>) -> Iter<'_> {
Iter {
bus: self,
timeout: timeout.into(),

View file

@ -823,19 +823,19 @@ impl CapsRef {
self.size()
}
pub fn iter(&self) -> Iter {
pub fn iter(&self) -> Iter<'_> {
Iter::new(self)
}
pub fn iter_mut(&mut self) -> IterMut {
pub fn iter_mut(&mut self) -> IterMut<'_> {
IterMut::new(self)
}
pub fn iter_with_features(&self) -> IterFeatures {
pub fn iter_with_features(&self) -> IterFeatures<'_> {
IterFeatures::new(self)
}
pub fn iter_with_features_mut(&mut self) -> IterFeaturesMut {
pub fn iter_with_features_mut(&mut self) -> IterFeaturesMut<'_> {
IterFeaturesMut::new(self)
}

View file

@ -554,7 +554,7 @@ impl CapsFeaturesRef {
unsafe { ffi::gst_caps_features_remove_id(self.as_mut_ptr(), feature.into_glib()) }
}
pub fn iter(&self) -> Iter {
pub fn iter(&self) -> Iter<'_> {
Iter::new(self)
}

View file

@ -14,7 +14,7 @@ impl ElementFactory {
#[doc(alias = "gst_element_factory_create")]
#[doc(alias = "gst_element_factory_create_with_properties")]
#[track_caller]
pub fn create(&self) -> ElementBuilder {
pub fn create(&self) -> ElementBuilder<'_> {
assert_initialized_main_thread!();
ElementBuilder {
name_or_factory: NameOrFactory::Factory(self),
@ -25,7 +25,7 @@ impl ElementFactory {
#[doc(alias = "gst_element_factory_make")]
#[doc(alias = "gst_element_factory_make_with_properties")]
#[track_caller]
pub fn make(factoryname: &str) -> ElementBuilder {
pub fn make(factoryname: &str) -> ElementBuilder<'_> {
assert_initialized_main_thread!();
ElementBuilder {
name_or_factory: NameOrFactory::Name(factoryname),

View file

@ -245,7 +245,7 @@ impl EventRef {
self.structure().is_some_and(|s| s.has_name(name))
}
pub fn view(&self) -> EventView {
pub fn view(&self) -> EventView<'_> {
unsafe {
let type_ = (*self.as_ptr()).type_;
@ -288,7 +288,7 @@ impl EventRef {
}
}
pub fn view_mut(&mut self) -> EventViewMut {
pub fn view_mut(&mut self) -> EventViewMut<'_> {
unsafe {
let type_ = (*self.as_ptr()).type_;
@ -632,7 +632,7 @@ impl StreamStart<Event> {
Self::builder(stream_id).build()
}
pub fn builder(stream_id: &str) -> StreamStartBuilder {
pub fn builder(stream_id: &str) -> StreamStartBuilder<'_> {
assert_initialized_main_thread!();
StreamStartBuilder::new(stream_id)
}
@ -726,7 +726,7 @@ impl Caps<Event> {
Self::builder(caps).build()
}
pub fn builder(caps: &crate::Caps) -> CapsBuilder {
pub fn builder(caps: &crate::Caps) -> CapsBuilder<'_> {
assert_initialized_main_thread!();
CapsBuilder::new(caps)
}
@ -779,7 +779,7 @@ impl Segment<Event> {
pub fn builder<F: FormattedValueIntrinsic>(
segment: &crate::FormattedSegment<F>,
) -> SegmentBuilder {
) -> SegmentBuilder<'_> {
assert_initialized_main_thread!();
SegmentBuilder::new(segment.as_ref())
}
@ -824,7 +824,7 @@ impl StreamCollection<Event> {
Self::builder(stream_collection).build()
}
pub fn builder(stream_collection: &crate::StreamCollection) -> StreamCollectionBuilder {
pub fn builder(stream_collection: &crate::StreamCollection) -> StreamCollectionBuilder<'_> {
assert_initialized_main_thread!();
StreamCollectionBuilder::new(stream_collection)
}
@ -1116,7 +1116,7 @@ impl Toc<Event> {
Self::builder(toc, updated).build()
}
pub fn builder(toc: &crate::Toc, updated: bool) -> TocBuilder {
pub fn builder(toc: &crate::Toc, updated: bool) -> TocBuilder<'_> {
assert_initialized_main_thread!();
TocBuilder::new(toc, updated)
}
@ -1799,7 +1799,7 @@ impl TocSelect<Event> {
Self::builder(uid).build()
}
pub fn builder(uid: &str) -> TocSelectBuilder {
pub fn builder(uid: &str) -> TocSelectBuilder<'_> {
assert_initialized_main_thread!();
TocSelectBuilder::new(uid)
}

View file

@ -39,7 +39,7 @@ impl fmt::Debug for DebugMessage {
impl DebugMessage {
#[doc(alias = "gst_debug_message_get")]
#[inline]
pub fn get(&self) -> Option<Cow<glib::GStr>> {
pub fn get(&self) -> Option<Cow<'_, glib::GStr>> {
unsafe {
let message = ffi::gst_debug_message_get(self.0.as_ptr());

View file

@ -269,7 +269,7 @@ impl MemoryRef {
}
#[inline]
pub fn map_readable(&self) -> Result<MemoryMap<Readable>, glib::BoolError> {
pub fn map_readable(&self) -> Result<MemoryMap<'_, Readable>, glib::BoolError> {
unsafe {
let mut map_info = mem::MaybeUninit::uninit();
let res =
@ -286,7 +286,7 @@ impl MemoryRef {
}
#[inline]
pub fn map_writable(&mut self) -> Result<MemoryMap<Writable>, glib::BoolError> {
pub fn map_writable(&mut self) -> Result<MemoryMap<'_, Writable>, glib::BoolError> {
unsafe {
let mut map_info = mem::MaybeUninit::uninit();
let res = ffi::gst_memory_map(
@ -330,7 +330,7 @@ impl MemoryRef {
}
#[doc(alias = "gst_util_dump_mem")]
pub fn dump(&self) -> Dump {
pub fn dump(&self) -> Dump<'_> {
Dump {
memory: self,
start: Bound::Unbounded,
@ -339,7 +339,7 @@ impl MemoryRef {
}
#[doc(alias = "gst_util_dump_mem")]
pub fn dump_range(&self, range: impl RangeBounds<usize>) -> Dump {
pub fn dump_range(&self, range: impl RangeBounds<usize>) -> Dump<'_> {
Dump {
memory: self,
start: range.start_bound().cloned(),

View file

@ -130,7 +130,7 @@ impl MessageRef {
self.structure().is_some_and(|s| s.has_name(name))
}
pub fn view(&self) -> MessageView {
pub fn view(&self) -> MessageView<'_> {
unsafe {
let type_ = (*self.as_ptr()).type_;
@ -181,7 +181,7 @@ impl MessageRef {
}
}
pub fn view_mut(&mut self) -> MessageViewMut {
pub fn view_mut(&mut self) -> MessageViewMut<'_> {
unsafe {
let type_ = (*self.as_ptr()).type_;
@ -515,7 +515,7 @@ impl Error {
Self::builder(error, message).build()
}
pub fn builder<T: MessageErrorDomain>(error: T, message: &str) -> ErrorBuilder {
pub fn builder<T: MessageErrorDomain>(error: T, message: &str) -> ErrorBuilder<'_> {
assert_initialized_main_thread!();
ErrorBuilder::new(glib::Error::new(error, message))
}
@ -620,7 +620,7 @@ impl Warning {
Self::builder(error, message).build()
}
pub fn builder<T: MessageErrorDomain>(error: T, message: &str) -> WarningBuilder {
pub fn builder<T: MessageErrorDomain>(error: T, message: &str) -> WarningBuilder<'_> {
assert_initialized_main_thread!();
WarningBuilder::new(glib::Error::new(error, message))
}
@ -725,7 +725,7 @@ impl Info {
Self::builder(error, message).build()
}
pub fn builder<T: MessageErrorDomain>(error: T, message: &str) -> InfoBuilder {
pub fn builder<T: MessageErrorDomain>(error: T, message: &str) -> InfoBuilder<'_> {
assert_initialized_main_thread!();
InfoBuilder::new(glib::Error::new(error, message))
}
@ -1160,7 +1160,7 @@ impl ClockProvide {
Self::builder(clock, ready).build()
}
pub fn builder(clock: &crate::Clock, ready: bool) -> ClockProvideBuilder {
pub fn builder(clock: &crate::Clock, ready: bool) -> ClockProvideBuilder<'_> {
assert_initialized_main_thread!();
ClockProvideBuilder::new(clock, ready)
}
@ -1220,7 +1220,7 @@ impl ClockLost {
Self::builder(clock).build()
}
pub fn builder(clock: &crate::Clock) -> ClockLostBuilder {
pub fn builder(clock: &crate::Clock) -> ClockLostBuilder<'_> {
assert_initialized_main_thread!();
ClockLostBuilder::new(clock)
}
@ -1263,7 +1263,7 @@ impl NewClock {
Self::builder(clock).build()
}
pub fn builder(clock: &crate::Clock) -> NewClockBuilder {
pub fn builder(clock: &crate::Clock) -> NewClockBuilder<'_> {
assert_initialized_main_thread!();
NewClockBuilder::new(clock)
}
@ -1310,7 +1310,7 @@ impl StructureChange {
type_: crate::StructureChangeType,
owner: &crate::Element,
busy: bool,
) -> StructureChangeBuilder {
) -> StructureChangeBuilder<'_> {
assert_initialized_main_thread!();
StructureChangeBuilder::new(type_, owner, busy)
}
@ -1367,7 +1367,10 @@ impl StreamStatus {
Self::builder(type_, owner).build()
}
pub fn builder(type_: crate::StreamStatusType, owner: &crate::Element) -> StreamStatusBuilder {
pub fn builder(
type_: crate::StreamStatusType,
owner: &crate::Element,
) -> StreamStatusBuilder<'_> {
assert_initialized_main_thread!();
StreamStatusBuilder::new(type_, owner)
}
@ -2034,7 +2037,7 @@ impl Toc {
Self::builder(toc, updated).build()
}
pub fn builder(toc: &crate::Toc, updated: bool) -> TocBuilder {
pub fn builder(toc: &crate::Toc, updated: bool) -> TocBuilder<'_> {
assert_initialized_main_thread!();
TocBuilder::new(toc, updated)
}
@ -2179,7 +2182,7 @@ impl NeedContext {
Self::builder(context_type).build()
}
pub fn builder(context_type: &str) -> NeedContextBuilder {
pub fn builder(context_type: &str) -> NeedContextBuilder<'_> {
assert_initialized_main_thread!();
NeedContextBuilder::new(context_type)
}
@ -2263,7 +2266,7 @@ impl DeviceAdded {
Self::builder(device).build()
}
pub fn builder(device: &crate::Device) -> DeviceAddedBuilder {
pub fn builder(device: &crate::Device) -> DeviceAddedBuilder<'_> {
assert_initialized_main_thread!();
DeviceAddedBuilder::new(device)
}
@ -2306,7 +2309,7 @@ impl DeviceRemoved {
Self::builder(device).build()
}
pub fn builder(device: &crate::Device) -> DeviceRemovedBuilder {
pub fn builder(device: &crate::Device) -> DeviceRemovedBuilder<'_> {
assert_initialized_main_thread!();
DeviceRemovedBuilder::new(device)
}
@ -2412,7 +2415,7 @@ impl StreamCollection {
Self::builder(collection).build()
}
pub fn builder(collection: &crate::StreamCollection) -> StreamCollectionBuilder {
pub fn builder(collection: &crate::StreamCollection) -> StreamCollectionBuilder<'_> {
assert_initialized_main_thread!();
StreamCollectionBuilder::new(collection)
}
@ -2455,7 +2458,7 @@ impl StreamsSelected {
Self::builder(collection).build()
}
pub fn builder(collection: &crate::StreamCollection) -> StreamsSelectedBuilder {
pub fn builder(collection: &crate::StreamCollection) -> StreamsSelectedBuilder<'_> {
assert_initialized_main_thread!();
StreamsSelectedBuilder::new(collection)
}
@ -2529,7 +2532,7 @@ impl Redirect {
Self::builder(location).build()
}
pub fn builder(location: &str) -> RedirectBuilder {
pub fn builder(location: &str) -> RedirectBuilder<'_> {
assert_initialized_main_thread!();
RedirectBuilder::new(location)
}

View file

@ -22,7 +22,7 @@ pub unsafe trait MetaAPI: Sync + Send + Sized {
pub trait MetaAPIExt: MetaAPI {
#[inline]
unsafe fn from_ptr(buffer: &BufferRef, ptr: *const Self::GstType) -> MetaRef<Self> {
unsafe fn from_ptr(buffer: &BufferRef, ptr: *const Self::GstType) -> MetaRef<'_, Self> {
debug_assert!(!ptr.is_null());
let meta_api = Self::meta_api();
@ -43,7 +43,7 @@ pub trait MetaAPIExt: MetaAPI {
unsafe fn from_mut_ptr<T>(
buffer: &mut BufferRef,
ptr: *mut Self::GstType,
) -> MetaRefMut<Self, T> {
) -> MetaRefMut<'_, Self, T> {
debug_assert!(!ptr.is_null());
let meta_api = Self::meta_api();
@ -479,7 +479,7 @@ impl<'a, T, U> MetaRefMut<'a, T, U> {
}
#[inline]
pub fn as_meta_ref(&self) -> MetaRef<T> {
pub fn as_meta_ref(&self) -> MetaRef<'_, T> {
MetaRef {
meta: self.meta,
buffer: self.buffer,
@ -745,7 +745,7 @@ unsafe impl Sync for ProtectionMeta {}
impl ProtectionMeta {
#[doc(alias = "gst_buffer_add_protection_meta")]
pub fn add(buffer: &mut BufferRef, info: crate::Structure) -> MetaRefMut<Self, Standalone> {
pub fn add(buffer: &mut BufferRef, info: crate::Structure) -> MetaRefMut<'_, Self, Standalone> {
skip_assert_initialized!();
unsafe {
let meta =

View file

@ -209,7 +209,7 @@ macro_rules! mini_object_wrapper (
type Storage = std::marker::PhantomData<&'a mut Self>;
#[inline]
fn to_glib_none_mut(&'_ mut self) -> $crate::glib::translate::StashMut<*mut $ffi_name, Self> {
fn to_glib_none_mut(&'_ mut self) -> $crate::glib::translate::StashMut<'_, *mut $ffi_name, Self> {
self.make_mut();
$crate::glib::translate::StashMut(self.as_mut_ptr(), std::marker::PhantomData)
}

View file

@ -98,7 +98,7 @@ pub trait GstObjectExtManual: IsA<Object> + 'static {
}
#[inline]
fn object_lock(&self) -> crate::utils::ObjectLockGuard<Self> {
fn object_lock(&self) -> crate::utils::ObjectLockGuard<'_, Self> {
crate::utils::ObjectLockGuard::acquire(self)
}
}

View file

@ -379,7 +379,7 @@ pub trait PadExtManual: IsA<Pad> + 'static {
}
}
fn stream_lock(&self) -> StreamLock {
fn stream_lock(&self) -> StreamLock<'_> {
unsafe {
let ptr: &mut ffi::GstPad = &mut *(self.as_ptr() as *mut _);
glib::ffi::g_rec_mutex_lock(&mut ptr.stream_rec_lock);

View file

@ -50,7 +50,7 @@ impl FromGlibPtrFull<*mut gobject_ffi::GParamSpec> for ParamSpecFraction {
impl ParamSpecFraction {
#[doc(alias = "gst_param_spec_fraction")]
pub fn builder(name: &str) -> ParamSpecFractionBuilder {
pub fn builder(name: &str) -> ParamSpecFractionBuilder<'_> {
assert_initialized_main_thread!();
ParamSpecFractionBuilder::new(name)
}
@ -246,7 +246,7 @@ impl FromGlibPtrFull<*mut gobject_ffi::GParamSpec> for ParamSpecArray {
impl ParamSpecArray {
#[doc(alias = "gst_param_spec_array")]
pub fn builder(name: &str) -> ParamSpecArrayBuilder {
pub fn builder(name: &str) -> ParamSpecArrayBuilder<'_> {
assert_initialized_main_thread!();
ParamSpecArrayBuilder::new(name)
}

View file

@ -92,7 +92,7 @@ impl QueryRef {
unsafe { from_glib((*self.as_ptr()).type_) }
}
pub fn view(&self) -> QueryView {
pub fn view(&self) -> QueryView<'_> {
unsafe {
let type_ = (*self.as_ptr()).type_;
@ -122,7 +122,7 @@ impl QueryRef {
}
}
pub fn view_mut(&mut self) -> QueryViewMut {
pub fn view_mut(&mut self) -> QueryViewMut<'_> {
unsafe {
let type_ = (*self.as_ptr()).type_;

View file

@ -7,17 +7,17 @@ use std::{
pub trait ByteSliceExt {
#[doc(alias = "gst_util_dump_mem")]
fn dump(&self) -> Dump;
fn dump(&self) -> Dump<'_>;
#[doc(alias = "gst_util_dump_mem")]
fn dump_range(&self, range: impl RangeBounds<usize>) -> Dump;
fn dump_range(&self, range: impl RangeBounds<usize>) -> Dump<'_>;
}
impl<T: AsRef<[u8]>> ByteSliceExt for T {
fn dump(&self) -> Dump {
fn dump(&self) -> Dump<'_> {
self.dump_range(..)
}
fn dump_range(&self, range: impl RangeBounds<usize>) -> Dump {
fn dump_range(&self, range: impl RangeBounds<usize>) -> Dump<'_> {
Dump {
data: self.as_ref(),
start: range.start_bound().cloned(),

View file

@ -5,7 +5,7 @@ use std::fmt;
use crate::Stream;
impl Stream {
pub fn debug(&self) -> Debug {
pub fn debug(&self) -> Debug<'_> {
Debug(self)
}
}

View file

@ -168,7 +168,7 @@ impl StreamCollection {
}
}
pub fn iter(&self) -> Iter {
pub fn iter(&self) -> Iter<'_> {
Iter::new(self)
}
@ -180,7 +180,7 @@ impl StreamCollection {
self.len() == 0
}
pub fn debug(&self) -> Debug {
pub fn debug(&self) -> Debug<'_> {
Debug(self)
}
}

View file

@ -1291,21 +1291,21 @@ impl StructureRef {
}
}
pub fn fields(&self) -> FieldIterator {
pub fn fields(&self) -> FieldIterator<'_> {
FieldIterator::new(self)
}
pub fn iter(&self) -> Iter {
pub fn iter(&self) -> Iter<'_> {
Iter::new(self)
}
#[cfg(feature = "v1_26")]
pub fn field_ids(&self) -> FieldIdIterator {
pub fn field_ids(&self) -> FieldIdIterator<'_> {
FieldIdIterator::new(self)
}
#[cfg(feature = "v1_26")]
pub fn id_iter(&self) -> IdIter {
pub fn id_iter(&self) -> IdIter<'_> {
IdIter::new(self)
}

View file

@ -538,11 +538,11 @@ impl TagListRef {
GenericTagIter::new(self, tag_name)
}
pub fn iter_generic(&self) -> GenericIter {
pub fn iter_generic(&self) -> GenericIter<'_> {
GenericIter::new(self)
}
pub fn iter(&self) -> Iter {
pub fn iter(&self) -> Iter<'_> {
Iter::new(self)
}

View file

@ -219,7 +219,7 @@ impl TaskLock {
// checker-ignore-item
#[inline]
pub fn lock(&self) -> TaskLockGuard {
pub fn lock(&self) -> TaskLockGuard<'_> {
unsafe {
let guard = TaskLockGuard(&self.0);
glib::ffi::g_rec_mutex_lock(mut_override(&self.0 .0));