pub struct Sender<T> { /* private fields */ }
Expand description
a Sender is used to push Sample
s to the Receiver
it is clonable for sharing between threads
Implementations§
Source§impl<T: Hash + Eq + Send + Clone> Sender<T>
impl<T: Hash + Eq + Send + Clone> Sender<T>
Sourcepub fn new(
rx_queue: Arc<Queue<Vec<Sample<T>>>>,
data_tx: SyncSender<Vec<Sample<T>>>,
control_tx: SyncSender<ControlMessage<T>>,
batch_size: usize,
) -> Sender<T>
pub fn new( rx_queue: Arc<Queue<Vec<Sample<T>>>>, data_tx: SyncSender<Vec<Sample<T>>>, control_tx: SyncSender<ControlMessage<T>>, batch_size: usize, ) -> Sender<T>
create a new Sender
for use in client threads
Sourcepub fn send(&mut self, sample: Sample<T>) -> Result<(), Error>
pub fn send(&mut self, sample: Sample<T>) -> Result<(), Error>
a function to send a Sample
to the Receiver
Sourcepub fn add_interest(&mut self, interest: Interest<T>)
pub fn add_interest(&mut self, interest: Interest<T>)
register an Interest
Sourcepub fn remove_interest(&mut self, interest: Interest<T>)
pub fn remove_interest(&mut self, interest: Interest<T>)
de-register an Interest
Sourcepub fn set_batch_size(&mut self, batch_size: usize)
pub fn set_batch_size(&mut self, batch_size: usize)
a function to change the batch size of the Sender
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Sender<T>
impl<T> !RefUnwindSafe for Sender<T>
impl<T> Send for Sender<T>
impl<T> Sync for Sender<T>
impl<T> Unpin for Sender<T>where
T: Unpin,
impl<T> !UnwindSafe for Sender<T>
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