pub struct Sender<T> { /* private fields */ }Expand description
The ‘send’ side of hopper, similar to std::sync::mpsc::Sender.
Implementations§
Source§impl<T> Sender<T>where
T: Serialize,
impl<T> Sender<T>where
T: Serialize,
Sourcepub fn flush(&mut self) -> Result<(), Error>
pub fn flush(&mut self) -> Result<(), Error>
Attempt to flush any outstanding disk writes to the deque
This function will attempt to flush outstanding disk writes, which may fail if the in-memory buffer is full. This function is useful when traffic patterns are bursty, meaning a write may end up being stranded in limbo for a good spell.
Sourcepub fn send(&mut self, event: T) -> Result<(), (T, Error)>
pub fn send(&mut self, event: T) -> Result<(), (T, Error)>
Send a event into the queue
This function will fail with IO errors if the underlying queue files are
temporarily exhausted – say, due to lack of file descriptors – of with
Full if there is no more space in the in-memory buffer or on disk, as
per the max_disk_files setting from
channel_with_explicit_capacity. Ownership of the event will be
returned back to the caller on failure.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Sender<T>
impl<T> RefUnwindSafe for Sender<T>where
T: RefUnwindSafe,
impl<T> Send for Sender<T>where
T: Send,
impl<T> Sync for Sender<T>where
T: Sync,
impl<T> Unpin for Sender<T>where
T: Unpin,
impl<T> UnwindSafe for Sender<T>where
T: UnwindSafe + RefUnwindSafe,
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