Struct vapoursynth::node::Node
source · [−]pub struct Node<'core> { /* private fields */ }
Expand description
A reference to a node in the constructed filter graph.
Implementations
sourceimpl<'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_value()
.
sourcepub fn get_frame_async<F>(&self, n: usize, callback: F) where
F: FnOnce(Result<FrameRef<'core>, GetFrameError<'_>>, usize, Node<'core>) + Send + 'core,
pub fn get_frame_async<F>(&self, n: usize, callback: F) where
F: FnOnce(Result<FrameRef<'core>, GetFrameError<'_>>, usize, Node<'core>) + Send + 'core,
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_value()
.
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_value()
.
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_value()
.
Trait Implementations
sourceimpl<'map, 'elem: 'map> FilterArgument<'map, 'elem> for Node<'elem>
impl<'map, 'elem: 'map> FilterArgument<'map, 'elem> for Node<'elem>
sourceimpl<'map, 'elem: 'map> Value<'map, 'elem> for Node<'elem>
impl<'map, 'elem: 'map> Value<'map, 'elem> for Node<'elem>
sourcefn get_from_map(map: &Map<'elem>, key: &str) -> Result<Self>
fn get_from_map(map: &Map<'elem>, key: &str) -> Result<Self>
Retrieves the value from the map.
sourcefn get_iter_from_map(
map: &'map Map<'elem>,
key: &str
) -> Result<ValueIter<'map, 'elem, Self>>
fn get_iter_from_map(
map: &'map Map<'elem>,
key: &str
) -> Result<ValueIter<'map, 'elem, Self>>
Retrieves an iterator over the values from the map.
impl<'core> Send for Node<'core>
impl<'core> Sync for Node<'core>
Auto Trait Implementations
impl<'core> RefUnwindSafe for Node<'core>
impl<'core> Unpin for Node<'core>
impl<'core> UnwindSafe for Node<'core>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<'map, 'elem, T> FilterParameter<'map, 'elem> for T where
'elem: 'map,
T: FilterArgument<'map, 'elem>,
impl<'map, 'elem, T> FilterParameter<'map, 'elem> for T where
'elem: 'map,
T: FilterArgument<'map, 'elem>,
type Argument = T
type Argument = T
The underlying argument type for this parameter type.
sourcefn is_optional() -> bool
fn is_optional() -> bool
Returns whether this parameter is optional.
sourcefn get_from_map(map: &'map Map<'elem>, key: &str) -> T
fn get_from_map(map: &'map Map<'elem>, key: &str) -> T
Retrieves this parameter from the given map.
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more