lib: Only export traits (Ext and ExtManual) from prelude

In gir it was brought up [1] that some traits (in particular
`*ExtManual`) are exported from the crate root in addition to the
prelude, cluttering the environment unnecessarily.  This commit removes
all these reexports, leaving those in prelude (that were already there)
only.

After this commit everything matching `Ext(Manual)?\b` in `lib.rs` sits
within `pub mod prelude {};`.

[1]: https://github.com/gtk-rs/gir/pull/1111
This commit is contained in:
Marijn Suijten 2021-04-24 22:41:35 +02:00
parent 5b7b39c448
commit 827ff99965
11 changed files with 50 additions and 109 deletions

View file

@ -50,9 +50,7 @@ pub mod audio_buffer;
pub use audio_buffer::{AudioBuffer, AudioBufferRef};
mod audio_decoder;
pub use crate::audio_decoder::AudioDecoderExtManual;
mod audio_encoder;
pub use crate::audio_encoder::AudioEncoderExtManual;
mod audio_converter;
pub use crate::audio_converter::AudioConverterConfig;

View file

@ -38,21 +38,11 @@ pub use crate::flow_combiner::*;
mod aggregator;
#[cfg(any(feature = "v1_14", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))]
pub use aggregator::AggregatorExtManual;
#[cfg(any(feature = "v1_14", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))]
mod aggregator_pad;
#[cfg(any(feature = "v1_14", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))]
pub use aggregator_pad::AggregatorPadExtManual;
mod base_parse;
pub use crate::base_parse::BaseParseExtManual;
mod base_sink;
pub use crate::base_sink::BaseSinkExtManual;
mod base_src;
pub use crate::base_src::BaseSrcExtManual;
mod base_transform;
pub use crate::base_transform::BaseTransformExtManual;
pub mod base_parse_frame;
pub use crate::base_parse_frame::BaseParseFrame;

View file

@ -56,7 +56,6 @@ mod auto;
pub use crate::auto::*;
mod timeline_element;
pub use crate::timeline_element::TimelineElementExtManual;
// Re-export all the traits in a prelude module, so that applications
// can always "use gst::prelude::*" without getting conflicts

View file

@ -29,14 +29,11 @@ pub use crate::auto::*;
mod caps_features;
pub use crate::caps_features::{CAPS_FEATURES_MEMORY_GL_MEMORY, CAPS_FEATURE_MEMORY_GL_MEMORY};
mod context;
pub use crate::context::ContextGLExt;
mod gl_context;
pub use crate::gl_context::GLContextExtManual;
mod gl_display;
pub use crate::gl_display::GL_DISPLAY_CONTEXT_TYPE;
mod gl_video_frame;
pub use crate::gl_video_frame::VideoFrameGLExt;
mod gl_sync_meta;
mod gl_video_frame;
pub use crate::gl_sync_meta::*;
mod gl_base_memory;
pub use self::gl_base_memory::*;

View file

@ -26,7 +26,7 @@ mod auto;
pub use crate::auto::*;
pub mod rtp_buffer;
pub use crate::rtp_buffer::{compare_seqnum, RTPBuffer, RTPBufferExt};
pub use crate::rtp_buffer::{compare_seqnum, RTPBuffer};
// Re-export all the traits in a prelude module, so that applications
// can always "use gst::prelude::*" without getting conflicts

View file

@ -45,18 +45,8 @@ mod rtsp_token;
pub mod subclass;
pub use crate::rtsp_address_pool::RTSPAddressPoolExtManual;
pub use crate::rtsp_auth::RTSPAuthExtManual;
pub use crate::rtsp_client::RTSPClientExtManual;
pub use crate::rtsp_media::RTSPMediaExtManual;
pub use crate::rtsp_media_factory::RTSPMediaFactoryExtManual;
pub use crate::rtsp_server::RTSPServerExtManual;
pub use crate::rtsp_session_pool::RTSPSessionPoolExtManual;
pub use crate::rtsp_stream::RTSPStreamExtManual;
pub use crate::rtsp_stream_transport::RTSPStreamTransportExtManual;
pub use crate::rtsp_thread::*;
pub use crate::rtsp_context::*;
pub use crate::rtsp_thread::*;
pub use crate::rtsp_token::*;
use once_cell::sync::Lazy;

View file

@ -46,11 +46,9 @@ pub use crate::video_format_info::*;
mod video_info;
pub use crate::video_info::*;
pub mod video_frame;
pub use crate::video_frame::{VideoBufferExt, VideoFrame, VideoFrameRef};
pub use crate::video_frame::{VideoFrame, VideoFrameRef};
mod video_overlay;
pub use crate::video_overlay::{
is_video_overlay_prepare_window_handle_message, VideoOverlayExtManual,
};
pub use crate::video_overlay::is_video_overlay_prepare_window_handle_message;
pub mod video_event;
pub use crate::video_event::{
DownstreamForceKeyUnitEvent, ForceKeyUnitEvent, StillFrameEvent, UpstreamForceKeyUnitEvent,
@ -95,10 +93,8 @@ pub use crate::video_converter::{VideoConverter, VideoConverterConfig};
mod video_codec_frame;
mod video_decoder;
pub use crate::video_decoder::VideoDecoderExtManual;
mod video_encoder;
pub use crate::video_codec_frame::VideoCodecFrame;
pub use crate::video_encoder::VideoEncoderExtManual;
pub mod video_codec_state;
pub use crate::video_codec_state::{VideoCodecState, VideoCodecStateContext};
mod utils;

View file

@ -914,7 +914,7 @@ pub static ELEMENT_METADATA_LONGNAME: Lazy<&'static str> = Lazy::new(|| unsafe {
#[macro_export]
macro_rules! element_error(
($obj:expr, $err:expr, ($msg:expr), [$debug:expr]) => { {
use $crate::ElementExtManual;
use $crate::prelude::ElementExtManual;
$obj.message_full(
$crate::ElementMessageType::Error,
$err,
@ -926,7 +926,7 @@ macro_rules! element_error(
);
}};
($obj:expr, $err:expr, ($msg:expr)) => { {
use $crate::ElementExtManual;
use $crate::prelude::ElementExtManual;
$obj.message_full(
$crate::ElementMessageType::Error,
$err,
@ -938,7 +938,7 @@ macro_rules! element_error(
);
}};
($obj:expr, $err:expr, [$debug:expr]) => { {
use $crate::ElementExtManual;
use $crate::prelude::ElementExtManual;
$obj.message_full(
$crate::ElementMessageType::Error,
$err,
@ -950,7 +950,7 @@ macro_rules! element_error(
);
}};
($obj:expr, $err:expr, ($($msg:tt)*), [$($debug:tt)*]) => { {
use $crate::ElementExtManual;
use $crate::prelude::ElementExtManual;
$obj.message_full(
$crate::ElementMessageType::Error,
$err,
@ -962,7 +962,7 @@ macro_rules! element_error(
);
}};
($obj:expr, $err:expr, ($($msg:tt)*)) => { {
use $crate::ElementExtManual;
use $crate::prelude::ElementExtManual;
$obj.message_full(
$crate::ElementMessageType::Error,
$err,
@ -974,7 +974,7 @@ macro_rules! element_error(
);
}};
($obj:expr, $err:expr, [$($debug:tt)*]) => { {
use $crate::ElementExtManual;
use $crate::prelude::ElementExtManual;
$obj.message_full(
$crate::ElementMessageType::Error,
$err,
@ -987,7 +987,7 @@ macro_rules! element_error(
}};
($obj:expr, $err:expr, ($msg:expr), [$debug:expr], details: $details:expr) => { {
use $crate::ElementExtManual;
use $crate::prelude::ElementExtManual;
$obj.message_full_with_details(
$crate::ElementMessageType::Error,
$err,
@ -1000,7 +1000,7 @@ macro_rules! element_error(
);
}};
($obj:expr, $err:expr, ($msg:expr), details: $details:expr) => { {
use $crate::ElementExtManual;
use $crate::prelude::ElementExtManual;
$obj.message_full_with_details(
$crate::ElementMessageType::Error,
$err,
@ -1013,7 +1013,7 @@ macro_rules! element_error(
);
}};
($obj:expr, $err:expr, [$debug:expr], details: $details:expr) => { {
use $crate::ElementExtManual;
use $crate::prelude::ElementExtManual;
$obj.message_full_with_details(
$crate::ElementMessageType::Error,
$err,
@ -1026,7 +1026,7 @@ macro_rules! element_error(
);
}};
($obj:expr, $err:expr, ($($msg:tt)*), [$($debug:tt)*], details: $details:expr) => { {
use $crate::ElementExtManual;
use $crate::prelude::ElementExtManual;
$obj.message_full_with_details(
$crate::ElementMessageType::Error,
$err,
@ -1039,7 +1039,7 @@ macro_rules! element_error(
);
}};
($obj:expr, $err:expr, ($($msg:tt)*), details: $details:expr) => { {
use $crate::ElementExtManual;
use $crate::prelude::ElementExtManual;
$obj.message_full_with_details(
$crate::ElementMessageType::Error,
$err,
@ -1052,7 +1052,7 @@ macro_rules! element_error(
);
}};
($obj:expr, $err:expr, [$($debug:tt)*], details: $details:expr) => { {
use $crate::ElementExtManual;
use $crate::prelude::ElementExtManual;
$obj.message_full_with_details(
$crate::ElementMessageType::Error,
$err,
@ -1069,7 +1069,7 @@ macro_rules! element_error(
#[macro_export]
macro_rules! element_warning(
($obj:expr, $err:expr, ($msg:expr), [$debug:expr]) => { {
use $crate::ElementExtManual;
use $crate::prelude::ElementExtManual;
$obj.message_full(
$crate::ElementMessageType::Warning,
$err,
@ -1081,7 +1081,7 @@ macro_rules! element_warning(
);
}};
($obj:expr, $err:expr, ($msg:expr)) => { {
use $crate::ElementExtManual;
use $crate::prelude::ElementExtManual;
$obj.message_full(
$crate::ElementMessageType::Warning,
$err,
@ -1093,7 +1093,7 @@ macro_rules! element_warning(
);
}};
($obj:expr, $err:expr, [$debug:expr]) => { {
use $crate::ElementExtManual;
use $crate::prelude::ElementExtManual;
$obj.message_full(
$crate::ElementMessageType::Warning,
$err,
@ -1105,7 +1105,7 @@ macro_rules! element_warning(
);
}};
($obj:expr, $err:expr, ($($msg:tt)*), [$($debug:tt)*]) => { {
use $crate::ElementExtManual;
use $crate::prelude::ElementExtManual;
$obj.message_full(
$crate::ElementMessageType::Warning,
$err,
@ -1117,7 +1117,7 @@ macro_rules! element_warning(
);
}};
($obj:expr, $err:expr, ($($msg:tt)*)) => { {
use $crate::ElementExtManual;
use $crate::prelude::ElementExtManual;
$obj.message_full(
$crate::ElementMessageType::Warning,
$err,
@ -1129,7 +1129,7 @@ macro_rules! element_warning(
);
}};
($obj:expr, $err:expr, [$($debug:tt)*]) => { {
use $crate::ElementExtManual;
use $crate::prelude::ElementExtManual;
$obj.message_full(
$crate::ElementMessageType::Warning,
$err,
@ -1142,7 +1142,7 @@ macro_rules! element_warning(
}};
($obj:expr, $err:expr, ($msg:expr), [$debug:expr], details: $details:expr) => { {
use $crate::ElementExtManual;
use $crate::prelude::ElementExtManual;
$obj.message_full_with_details(
$crate::ElementMessageType::Warning,
$err,
@ -1155,7 +1155,7 @@ macro_rules! element_warning(
);
}};
($obj:expr, $err:expr, ($msg:expr), details: $details:expr) => { {
use $crate::ElementExtManual;
use $crate::prelude::ElementExtManual;
$obj.message_full_with_details(
$crate::ElementMessageType::Warning,
$err,
@ -1168,7 +1168,7 @@ macro_rules! element_warning(
);
}};
($obj:expr, $err:expr, [$debug:expr], details: $details:expr) => { {
use $crate::ElementExtManual;
use $crate::prelude::ElementExtManual;
$obj.message_full_with_details(
$crate::ElementMessageType::Warning,
$err,
@ -1181,7 +1181,7 @@ macro_rules! element_warning(
);
}};
($obj:expr, $err:expr, ($($msg:tt)*), [$($debug:tt)*], details: $details:expr) => { {
use $crate::ElementExtManual;
use $crate::prelude::ElementExtManual;
$obj.message_full_with_details(
$crate::ElementMessageType::Warning,
$err,
@ -1194,7 +1194,7 @@ macro_rules! element_warning(
);
}};
($obj:expr, $err:expr, ($($msg:tt)*), details: $details:expr) => { {
use $crate::ElementExtManual;
use $crate::prelude::ElementExtManual;
$obj.message_full_with_details(
$crate::ElementMessageType::Warning,
$err,
@ -1207,7 +1207,7 @@ macro_rules! element_warning(
);
}};
($obj:expr, $err:expr, [$($debug:tt)*], details: $details:expr) => { {
use $crate::ElementExtManual;
use $crate::prelude::ElementExtManual;
$obj.message_full_with_details(
$crate::ElementMessageType::Warning,
$err,
@ -1224,7 +1224,7 @@ macro_rules! element_warning(
#[macro_export]
macro_rules! element_info(
($obj:expr, $err:expr, ($msg:expr), [$debug:expr]) => { {
use $crate::ElementExtManual;
use $crate::prelude::ElementExtManual;
$obj.message_full(
$crate::ElementMessageType::Info,
$err,
@ -1236,7 +1236,7 @@ macro_rules! element_info(
);
}};
($obj:expr, $err:expr, ($msg:expr)) => { {
use $crate::ElementExtManual;
use $crate::prelude::ElementExtManual;
$obj.message_full(
$crate::ElementMessageType::Info,
$err,
@ -1248,7 +1248,7 @@ macro_rules! element_info(
);
}};
($obj:expr, $err:expr, [$debug:expr]) => { {
use $crate::ElementExtManual;
use $crate::prelude::ElementExtManual;
$obj.message_full(
$crate::ElementMessageType::Info,
$err,
@ -1260,7 +1260,7 @@ macro_rules! element_info(
);
}};
($obj:expr, $err:expr, ($($msg:tt)*), [$($debug:tt)*]) => { {
use $crate::ElementExtManual;
use $crate::prelude::ElementExtManual;
$obj.message_full(
$crate::ElementMessageType::Info,
$err,
@ -1272,7 +1272,7 @@ macro_rules! element_info(
);
}};
($obj:expr, $err:expr, ($($msg:tt)*)) => { {
use $crate::ElementExtManual;
use $crate::prelude::ElementExtManual;
$obj.message_full(
$crate::ElementMessageType::Info,
$err,
@ -1284,7 +1284,7 @@ macro_rules! element_info(
);
}};
($obj:expr, $err:expr, [$($debug:tt)*]) => { {
use $crate::ElementExtManual;
use $crate::prelude::ElementExtManual;
$obj.message_full(
$crate::ElementMessageType::Info,
$err,
@ -1297,7 +1297,7 @@ macro_rules! element_info(
}};
($obj:expr, $err:expr, ($msg:expr), [$debug:expr], details: $details:expr) => { {
use $crate::ElementExtManual;
use $crate::prelude::ElementExtManual;
$obj.message_full_with_details(
$crate::ElementMessageType::Info,
$err,
@ -1310,7 +1310,7 @@ macro_rules! element_info(
);
}};
($obj:expr, $err:expr, ($msg:expr), details: $details:expr) => { {
use $crate::ElementExtManual;
use $crate::prelude::ElementExtManual;
$obj.message_full_with_details(
$crate::ElementMessageType::Info,
$err,
@ -1323,7 +1323,7 @@ macro_rules! element_info(
);
}};
($obj:expr, $err:expr, [$debug:expr], details: $details:expr) => { {
use $crate::ElementExtManual;
use $crate::prelude::ElementExtManual;
$obj.message_full_with_details(
$crate::ElementMessageType::Info,
$err,
@ -1336,7 +1336,7 @@ macro_rules! element_info(
);
}};
($obj:expr, $err:expr, ($($msg:tt)*), [$($debug:tt)*], details: $details:expr) => { {
use $crate::ElementExtManual;
use $crate::prelude::ElementExtManual;
$obj.message_full_with_details(
$crate::ElementMessageType::Info,
$err,
@ -1349,7 +1349,7 @@ macro_rules! element_info(
);
}};
($obj:expr, $err:expr, ($($msg:tt)*), details: $details:expr) => { {
use $crate::ElementExtManual;
use $crate::prelude::ElementExtManual;
$obj.message_full_with_details(
$crate::ElementMessageType::Info,
$err,
@ -1362,7 +1362,7 @@ macro_rules! element_info(
);
}};
($obj:expr, $err:expr, [$($debug:tt)*], details: $details:expr) => { {
use $crate::ElementExtManual;
use $crate::prelude::ElementExtManual;
$obj.message_full_with_details(
$crate::ElementMessageType::Info,
$err,

View file

@ -1,5 +1,6 @@
// Take a look at the license at the top of the repository in the LICENSE file.
use crate::prelude::{PadExt, PadExtManual};
use crate::FlowError;
use crate::FlowSuccess;
use crate::GhostPad;
@ -7,8 +8,6 @@ use crate::LoggableError;
use crate::Object;
use crate::Pad;
use crate::PadBuilder;
use crate::PadExt;
use crate::PadExtManual;
use crate::PadFlags;
use crate::PadGetRangeSuccess;
use crate::PadMode;

View file

@ -128,7 +128,6 @@ mod element;
mod bin;
mod pipeline;
pub use crate::pipeline::GstPipelineExtManual;
mod allocation_params;
pub use self::allocation_params::AllocationParams;
@ -173,49 +172,25 @@ mod control_binding;
mod control_source;
mod parse_context;
mod proxy_pad;
pub use crate::proxy_pad::ProxyPadExtManual;
mod tag_setter;
pub use crate::bin::GstBinExtManual;
pub use crate::element::{ElementExtManual, ElementMessageType, NotifyWatchId};
pub use crate::element::{ElementMessageType, NotifyWatchId};
pub use crate::element::{
ELEMENT_METADATA_AUTHOR, ELEMENT_METADATA_DESCRIPTION, ELEMENT_METADATA_DOC_URI,
ELEMENT_METADATA_ICON_NAME, ELEMENT_METADATA_KLASS, ELEMENT_METADATA_LONGNAME,
};
pub use crate::object::GstObjectExtManual;
// OS dependent Bus extensions (also import the other plateform trait for doc)
#[cfg(any(feature = "v1_14", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))]
cfg_if::cfg_if! {
if #[cfg(unix)] {
pub use bus_unix::UnixBusExtManual;
#[cfg(feature = "dox")]
pub use bus_windows::WindowsBusExtManual;
} else {
pub use bus_windows::WindowsBusExtManual;
#[cfg(feature = "dox")]
pub use bus_unix::UnixBusExtManual;
}
}
pub use self::iterator::{Iterator, IteratorError, IteratorImpl, StdIterator};
pub use crate::child_proxy::ChildProxyExtManual;
pub use crate::clock_time::ClockTime;
pub use crate::device_monitor::{DeviceMonitorExtManual, DeviceMonitorFilterId};
pub use crate::device_provider::DeviceProviderExtManual;
pub use crate::device_monitor::DeviceMonitorFilterId;
pub use crate::enums::{
ClockError, ClockSuccess, FlowError, FlowSuccess, PadLinkError, PadLinkSuccess,
StateChangeError, StateChangeSuccess, TagError,
};
pub use crate::gobject::GObjectExtManualGst;
pub use crate::pad::{PadExtManual, PadGetRangeSuccess, PadProbeData, PadProbeId, PadProbeInfo};
pub use crate::pad::{PadGetRangeSuccess, PadProbeData, PadProbeId, PadProbeInfo};
pub use crate::parse_context::ParseContext;
mod plugin_feature;
pub use crate::plugin_feature::PluginFeatureExtManual;
pub use crate::tag_setter::TagSetterExtManual;
mod plugin;
pub use crate::plugin::GstPluginExtManual;
#[cfg(any(feature = "v1_10", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
pub mod stream;
@ -242,9 +217,7 @@ pub use crate::toc::{Toc, TocEntry, TocEntryRef, TocRef};
mod toc_serde;
mod clock;
pub use crate::clock::{
AtomicClockReturn, ClockExtManual, ClockId, PeriodicClockId, SingleShotClockId,
};
pub use crate::clock::{AtomicClockReturn, ClockId, PeriodicClockId, SingleShotClockId};
mod buffer_pool;
pub use crate::buffer_pool::*;
@ -319,10 +292,7 @@ pub mod prelude {
pub use crate::meta::MetaAPI;
pub use crate::bin::GstBinExtManual;
pub use crate::element::{ElementClassExt, ElementExtManual};
// OS dependent Bus extensions (also import the other plateform trait for doc)
// OS dependent Bus extensions (also import the other platform trait for doc)
#[cfg(any(feature = "v1_14", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))]
cfg_if::cfg_if! {
@ -337,11 +307,13 @@ pub mod prelude {
}
}
pub use crate::bin::GstBinExtManual;
pub use crate::buffer_pool::BufferPoolExtManual;
pub use crate::child_proxy::ChildProxyExtManual;
pub use crate::clock::ClockExtManual;
pub use crate::device_monitor::DeviceMonitorExtManual;
pub use crate::device_provider::DeviceProviderExtManual;
pub use crate::element::{ElementClassExt, ElementExtManual};
pub use crate::gobject::GObjectExtManualGst;
pub use crate::message::MessageErrorDomain;
pub use crate::object::GstObjectExtManual;

View file

@ -10,7 +10,7 @@ macro_rules! panic_to_error(
($element:expr, $panicked:expr, $ret:expr, $code:block) => {{
use std::panic::{self, AssertUnwindSafe};
use std::sync::atomic::Ordering;
use $crate::ElementExtManual;
use $crate::prelude::ElementExtManual;
#[allow(clippy::unused_unit)]
{