pub struct MTGraph { /* private fields */ }Expand description
A graph is a thing that RustRadio runs, to let blocks “talk to each other” via streams.
§Example
use rustradio::graph::GraphRunner;
use rustradio::mtgraph::MTGraph;
use rustradio::Complex;
use rustradio::blocks::{FileSource,RtlSdrDecode,AddConst,NullSink};
let (src, prev) = FileSource::new("/dev/null")?;
let (dec, prev) = RtlSdrDecode::new(prev);
let (add, prev) = AddConst::new(prev, Complex::new(1.1, 2.0));
let sink = NullSink::new(prev);
let mut g = MTGraph::new();
g.add(Box::new(src));
g.add(Box::new(dec));
g.add(Box::new(add));
g.add(Box::new(sink));
g.run()?;Implementations§
Trait Implementations§
Source§impl GraphRunner for MTGraph
impl GraphRunner for MTGraph
Source§fn generate_stats(&self) -> Option<String>
fn generate_stats(&self) -> Option<String>
Return a string with stats about where time went.
MTGraph can’t measure per block CPU time, since rayon and other block
threading is not measurable.
Source§fn cancel_token(&self) -> CancellationToken
fn cancel_token(&self) -> CancellationToken
Return a cancellation token, for asynchronously stopping the
graph, for example if the user presses Ctrl-C. Read more
Auto Trait Implementations§
impl Freeze for MTGraph
impl !RefUnwindSafe for MTGraph
impl Send for MTGraph
impl !Sync for MTGraph
impl Unpin for MTGraph
impl UnsafeUnpin for MTGraph
impl !UnwindSafe for MTGraph
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> 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