realsense_rust/pipeline.rs
1//! Module containing pipeline types used in getting frames from the device.
2//!
3//! Pipelines are the core data type used to poll or wait for frames from librealsense2. The
4//! pipeline is constructed from a [`Context`](crate::context::Context), and streaming is started
5//! by feeding the pipeline a configuration (see: [`Config`](crate::config::Config)).
6//!
7//! In the librealsense2 C-API, there is no distinction between active (streaming / started)
8//! pipelines and inactive (not streaming / stopped) pipelines. The type is instead merely
9//! represented as a `* rs2_pipeline` for both scenarios. This leads to some of the APIs returning
10//! an error if they are called on a pipeline that is not started or a pipeline that is stopped.
11//!
12//! To reduce this error surface, we have produced two separate types, [`ActivePipeline`] and
13//! [`InactivePipeline`], which represent the two possible (valid) states of a pipeline. Interfaces
14//! that are only valid with an inactive (stopped) pipeline are only provided alongside the
15//! [`InactivePipeline`] type, while interfaces that are only valid with an active (started)
16//! pipeline are only provided alongside the [`ActivePipeline`] type.
17//!
18
19mod active;
20mod inactive;
21mod profile;
22
23pub use active::{ActivePipeline, FrameWaitError};
24pub use inactive::{InactivePipeline, PipelineActivationError, PipelineConstructionError};
25pub use profile::{PipelineProfile, PipelineProfileConstructionError};