pub struct ActivePipeline { /* private fields */ }
Expand description
Type representing an “active” pipeline which is configured and can acquire frames.
Implementations§
Source§impl ActivePipeline
impl ActivePipeline
Sourcepub fn profile(&self) -> &PipelineProfile
pub fn profile(&self) -> &PipelineProfile
Gets the active profile of pipeline.
Sourcepub fn stop(self) -> InactivePipeline
pub fn stop(self) -> InactivePipeline
Stop the pipeline.
This method consumes the pipeline instance and returns pipeline markered inactive.
Sourcepub fn wait(
&mut self,
timeout_ms: Option<Duration>,
) -> Result<CompositeFrame, FrameWaitError>
pub fn wait( &mut self, timeout_ms: Option<Duration>, ) -> Result<CompositeFrame, FrameWaitError>
Waits to get a new composite frame, blocking the calling thread.
Returns a composite frame from the pipeline, blocking the calling thread until a frame is
available. This method can return an error if an internal exception occurs or if the thread
waits more than the duration provided by timeout_ms
(in milliseconds).
§Arguments
timeout_ms
- The timeout in milliseconds. If the thread blocks for longer than this duration, it will exit early with aFrameWaitError::DidTimeoutBeforeFrameArrival
. IfNone
is passed in, the default timeout is applied.
§Errors
Returns FrameWaitError::DidErrorDuringFrameWait
if an internal error occurs while
waiting for next frame(s).
Returns FrameWaitError::DidTimeoutBeforeFrameArrival
if the thread waits more than
timeout_ms
(in milliseconds) without returning a frame.
Sourcepub fn poll(&mut self) -> Result<Poll<CompositeFrame>, FrameWaitError>
pub fn poll(&mut self) -> Result<Poll<CompositeFrame>, FrameWaitError>
Poll if next frame is immediately available.
Unlike ActivePipeline::wait
, the method does not block and returns None immediately if
the next frame is not available. Returns Poll::Pending
if no frame is yet available,
and returns Poll::Ready
if the next composite frame is found.
§Errors
Returns FrameWaitError::DidErrorDuringFramePoll
if an internal error occurs while
polling for the next frame.