Tagged
This commit is contained in:
@ -1,15 +1,18 @@
|
||||
use std::ops::{Add, Mul};
|
||||
use std::ops::Add;
|
||||
use std::ops::Mul;
|
||||
|
||||
use oxydsp_flowgraph::{
|
||||
BlockIO,
|
||||
block::{Block, BlockResult, SyncBlock},
|
||||
io::{In, Out, PopIterable},
|
||||
sync_block,
|
||||
tag::TagMergable,
|
||||
};
|
||||
use oxydsp_flowgraph::BlockIO;
|
||||
use oxydsp_flowgraph::block::Block;
|
||||
use oxydsp_flowgraph::block::BlockResult;
|
||||
use oxydsp_flowgraph::block::SyncBlock;
|
||||
use oxydsp_flowgraph::io::In;
|
||||
use oxydsp_flowgraph::io::Out;
|
||||
use oxydsp_flowgraph::io::PopIterable;
|
||||
use oxydsp_flowgraph::sync_block;
|
||||
use oxydsp_flowgraph::tag::TagMergable;
|
||||
|
||||
#[derive(BlockIO)]
|
||||
#[sync_block]
|
||||
#[sync_block(tagged)]
|
||||
pub struct Adder<Ia, Ib, O>
|
||||
where
|
||||
Ia: Add<Ib, Output = O> + 'static,
|
||||
|
||||
@ -1,9 +1,11 @@
|
||||
use oxydsp_flowgraph::{
|
||||
BlockIO,
|
||||
block::{Block, BlockResult},
|
||||
io::{In, Out, PopIterable, stream},
|
||||
tag::Tag,
|
||||
};
|
||||
use oxydsp_flowgraph::BlockIO;
|
||||
use oxydsp_flowgraph::block::Block;
|
||||
use oxydsp_flowgraph::block::BlockResult;
|
||||
use oxydsp_flowgraph::io::In;
|
||||
use oxydsp_flowgraph::io::Out;
|
||||
use oxydsp_flowgraph::io::PopIterable;
|
||||
use oxydsp_flowgraph::io::stream;
|
||||
use oxydsp_flowgraph::tag::Tag;
|
||||
|
||||
#[derive(BlockIO)]
|
||||
pub struct Map<I: 'static, O: 'static, F>
|
||||
@ -84,12 +86,12 @@ impl<T: Clone + 'static> Block for Repeat<T>
|
||||
{
|
||||
if self.remaining == 0 || self.current.is_none()
|
||||
{
|
||||
self.current = Some(reader.pop_tagged().unwrap());
|
||||
self.current = Some(reader.pop().unwrap().into());
|
||||
self.remaining = self.repetitions;
|
||||
}
|
||||
|
||||
writer
|
||||
.push(self.current.clone().unwrap())
|
||||
.push(self.current.clone().unwrap().into())
|
||||
.unwrap_or_else(|_| panic!());
|
||||
|
||||
match &mut self.current
|
||||
|
||||
@ -1,10 +1,14 @@
|
||||
use std::sync::mpsc::{Receiver, Sender, SyncSender};
|
||||
use std::sync::mpsc::Receiver;
|
||||
use std::sync::mpsc::Sender;
|
||||
use std::sync::mpsc::SyncSender;
|
||||
|
||||
use oxydsp_flowgraph::{
|
||||
BlockIO,
|
||||
block::{Block, BlockResult},
|
||||
io::{In, Out, PopIterable, stream},
|
||||
};
|
||||
use oxydsp_flowgraph::BlockIO;
|
||||
use oxydsp_flowgraph::block::Block;
|
||||
use oxydsp_flowgraph::block::BlockResult;
|
||||
use oxydsp_flowgraph::io::In;
|
||||
use oxydsp_flowgraph::io::Out;
|
||||
use oxydsp_flowgraph::io::PopIterable;
|
||||
use oxydsp_flowgraph::io::stream;
|
||||
|
||||
#[derive(BlockIO)]
|
||||
pub struct RxSource<Rx, I: 'static>
|
||||
|
||||
Reference in New Issue
Block a user