pub struct SourceNode<OUTPUT: WriteChannelTrait + 'static> {
pub id: String,
pub write_channel: TypedWriteChannel<OUTPUT>,
pub handler: Box<dyn SourceProcessor<OUTPUT = OUTPUT>>,
}Expand description
Source node structure. It is able to emit data without any input. The graph calls this node any time it’s not processing anything. Users must do their own frame rate control inside this method.
Fields§
§id: String§write_channel: TypedWriteChannel<OUTPUT>§handler: Box<dyn SourceProcessor<OUTPUT = OUTPUT>>Implementations§
Source§impl<OUTPUT: WriteChannelTrait + 'static> SourceNode<OUTPUT>
impl<OUTPUT: WriteChannelTrait + 'static> SourceNode<OUTPUT>
Sourcepub fn create(
id: String,
processor: Box<dyn SourceProcessor<OUTPUT = OUTPUT>>,
writer_channel: OUTPUT,
) -> SourceNode<OUTPUT>
pub fn create( id: String, processor: Box<dyn SourceProcessor<OUTPUT = OUTPUT>>, writer_channel: OUTPUT, ) -> SourceNode<OUTPUT>
Create a new SourceNode
- Arguments
id- Id of the node. It must be unique in the graph.processor- A boxed instance of the processor that handles the data packets.write_channel- A WriteChannel object for output data.
Sourcepub fn create_common(
id: String,
processor: Box<dyn SourceProcessor<OUTPUT = OUTPUT>>,
) -> Self
pub fn create_common( id: String, processor: Box<dyn SourceProcessor<OUTPUT = OUTPUT>>, ) -> Self
A helper method for creating a SourceNode with the most common parameters instead of manually passing a ReadChannel.
- Arguments
id- Id of the node. It must be unique in the graph.processor- A boxed instance of the processor that handles the data packets.
Auto Trait Implementations§
impl<OUTPUT> Freeze for SourceNode<OUTPUT>
impl<OUTPUT> !RefUnwindSafe for SourceNode<OUTPUT>
impl<OUTPUT> Send for SourceNode<OUTPUT>where
OUTPUT: Send,
impl<OUTPUT> Sync for SourceNode<OUTPUT>where
OUTPUT: Sync,
impl<OUTPUT> Unpin for SourceNode<OUTPUT>
impl<OUTPUT> !UnwindSafe for SourceNode<OUTPUT>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more