[−][src]Struct yaque::Receiver
The receiver part of the queue. This part is assynchronous and therefore needs an executor that will the poll the futures to completion.
Implementations
impl Receiver
[src]
pub fn open<P: AsRef<Path>>(base: P) -> Result<Receiver>
[src]
Opens a queue for reading. The access will be exclusive, based on the
existence of the temporary file recv.lock
inside the queue folder.
Errors
This function will return an IO error if the queue is already in use for receiving, which is indicated by a lock file. Also, any other IO error encountered while opening will be sent.
Panics
This function will panic if it is not able to set up the notification handler to watch for file changes.
pub async fn recv<'_, '_>(&'_ mut self) -> Result<RecvGuard<'_, Vec<u8>>>
[src]
Tries to retrieve an element from the queue. The returned value is a guard that will only commit state changes to the queue when dropped.
Panics
This function will panic if it has to start reading a new segment and it is not able to set up the notification handler to watch for file changes.
pub async fn recv_batch<'_, '_>(
&'_ mut self,
n: usize
) -> Result<RecvGuard<'_, Vec<Vec<u8>>>>
[src]
&'_ mut self,
n: usize
) -> Result<RecvGuard<'_, Vec<Vec<u8>>>>
Tries to remove a number of elements from the queue. The returned value is a guard that will only commit state changes to the queue when dropped.
Panics
This function will panic if it has to start reading a new segment and it is not able to set up the notification handler to watch for file changes.
pub async fn recv_while<'_, '_, P: FnMut(&[u8]) -> bool>(
&'_ mut self,
__arg1: P
) -> Result<RecvGuard<'_, Vec<Vec<u8>>>>
[src]
&'_ mut self,
__arg1: P
) -> Result<RecvGuard<'_, Vec<Vec<u8>>>>
Tries to a number of elements from the queue. The returned value is a guard that will only commit state changes to the queue when dropped.
Panics
This function will panic if it has to start reading a new segment and it is not able to set up the notification handler to watch for file changes.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Receiver
impl Send for Receiver
impl Sync for Receiver
impl Unpin for Receiver
impl UnwindSafe for Receiver
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Any for T where
T: Any,
T: Any,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,