Struct realsense_rust::pipeline::Pipeline[][src]

pub struct Pipeline<State> where
    State: PipelineState
{ /* fields omitted */ }

Represents the data pipeline from a RealSense device.

Implementations

impl Pipeline<Inactive>[src]

pub fn new() -> Result<Self>[src]

Creates an instance.

pub fn from_context(context: Context) -> Result<Self>[src]

Consumes a context and creates an instance.

pub fn start(self, config: impl Into<Option<Config>>) -> Result<ActivePipeline>[src]

Start the pipeline with optional config.

The method consumes inactive pipeline itself, and returns the started pipeine.

pub async fn start_async(
    self,
    config: impl Into<Option<Config>>
) -> Result<ActivePipeline>
[src]

Start the pipeline asynchronously. It is analogous to Pipeline::start.

pub fn into_raw_parts(self) -> (*mut rs2_pipeline, *mut rs2_context)[src]

Unpack the pipeline into raw pointers.

It returns the raw pointer along with the context pointer that the pipeline depends on.

pub unsafe fn from_raw_parts(
    pipeline_ptr: *mut rs2_pipeline,
    context_ptr: *mut rs2_context
) -> Self
[src]

Construct an inactive pipeline from raw pointers.

It assumes the pipeline pointers is built atop from the context pointer.

impl Pipeline<Active>[src]

pub fn profile(&self) -> &PipelineProfile[src]

Gets the active profile of pipeline.

pub fn wait(
    &mut self,
    timeout: impl Into<Option<Duration>>
) -> Result<Option<CompositeFrame>>
[src]

Block until the next frame is available.

When the timeout is set, it returns Ok(Some(frame)) if the frame is available, or returns Ok(None) when timeout occurs.

If the timeout is None, it waits indefinitely before the next frame.

pub fn try_wait(&mut self) -> Result<Option<CompositeFrame>>[src]

Poll if next frame is immediately available.

Unlike Pipeline::start, the method does not block and returns None if next from is not available.

pub async fn wait_async(
    &mut self,
    timeout: impl Into<Option<Duration>>
) -> Result<Option<CompositeFrame>>
[src]

Wait for the next frame asynchronously.

The method is analogous to Pipeline::wait.

When the timeout is set, it returns Ok(Some(frame)) if the frame is available, or returns Ok(None) when timeout occurs.

If the timeout is None, it waits indefinitely before the next frame.

pub fn stop(self) -> Result<InactivePipeline>[src]

Stop the pipeline.

This method consumes the pipeline instance and returns pipeline markered inactive.

pub fn into_raw_parts(
    self
) -> (*mut rs2_pipeline, *mut rs2_context, *mut rs2_pipeline_profile, Option<*mut rs2_config>)
[src]

Unpack the pipeline into raw pointers.

After calling this method, you have to take care of their lifetime manually.

pub unsafe fn from_raw_parts(
    pipeline_ptr: *mut rs2_pipeline,
    context_ptr: *mut rs2_context,
    profile_ptr: *mut rs2_pipeline_profile,
    config_ptr: Option<*mut rs2_config>
) -> Self
[src]

Construct an active pipeline from raw pointers.

It assumes the pipeline pointer is built from the context pointer, and profile pointer is the active profile of the pipeline.

Trait Implementations

impl<State: Debug> Debug for Pipeline<State> where
    State: PipelineState
[src]

impl<State> Drop for Pipeline<State> where
    State: PipelineState
[src]

impl<State> Send for Pipeline<State> where
    State: PipelineState
[src]

Auto Trait Implementations

impl<State> RefUnwindSafe for Pipeline<State> where
    State: RefUnwindSafe

impl<State> !Sync for Pipeline<State>

impl<State> Unpin for Pipeline<State> where
    State: Unpin

impl<State> UnwindSafe for Pipeline<State> where
    State: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,