pub struct Node<'core> { /* private fields */ }Expand description
A reference to a node in the constructed filter graph.
Implementations§
Source§impl<'core> Node<'core>
impl<'core> Node<'core>
Sourcepub fn get_frame<'error>(
&self,
n: usize,
) -> Result<FrameRef<'core>, GetFrameError<'error>>
pub fn get_frame<'error>( &self, n: usize, ) -> Result<FrameRef<'core>, GetFrameError<'error>>
Generates a frame directly.
The 'error lifetime is unbounded because this function always returns owned data.
§Panics
Panics is n is greater than i32::MAX.
Sourcepub fn get_frame_async<F>(&self, n: usize, callback: F)
pub fn get_frame_async<F>(&self, n: usize, callback: F)
Requests the generation of a frame. When the frame is ready, a user-provided function is called.
If multiple frames were requested, they can be returned in any order.
The callback arguments are:
- the generated frame or an error message if the generation failed,
- the frame number (equal to
n), - the node that generated the frame (the same as
self).
If the callback panics, the process is aborted.
§Panics
Panics is n is greater than i32::MAX.
Sourcepub fn request_frame_filter(&self, context: FrameContext<'_>, n: usize)
pub fn request_frame_filter(&self, context: FrameContext<'_>, n: usize)
Requests a frame from a node and returns immediately.
This is only used in filters’ “get frame” functions.
A filter usually calls this function from get_frame_initial(). The requested frame can
then be retrieved using get_frame_filter() from within filter’s get_frame() function.
It is safe to request a frame more than once. An unimportant consequence of requesting a
frame more than once is that the filter’s get_frame() function may be called more than
once for the same frame.
It is best to request frames in ascending order, i.e. n, n+1, n+2, etc.
§Panics
Panics is n is greater than i32::MAX.
Sourcepub fn get_frame_filter(
&self,
context: FrameContext<'_>,
n: usize,
) -> Option<FrameRef<'core>>
pub fn get_frame_filter( &self, context: FrameContext<'_>, n: usize, ) -> Option<FrameRef<'core>>
Retrieves a frame that was previously requested with request_frame_filter().
A filter usually calls this function from get_frame(). It is safe to retrieve a frame
more than once.
§Panics
Panics is n is greater than i32::MAX.