pub struct IpcReceiver<T> { /* private fields */ }Expand description
The receiving end of an IPC channel.
Use ipc_unbounded to declare a new channel.
Implementations§
Source§impl<T: IpcValue> IpcReceiver<T>
impl<T: IpcValue> IpcReceiver<T>
Sourcepub async fn recv(&mut self) -> Result<T, ChannelError>
pub async fn recv(&mut self) -> Result<T, ChannelError>
Wait for an incoming value from the channel associated with this receiver.
Returns an error if all senders have been dropped.
Sourcepub async fn recv_deadline(
&mut self,
deadline: impl Into<Deadline>,
) -> Result<T, ChannelError>
pub async fn recv_deadline( &mut self, deadline: impl Into<Deadline>, ) -> Result<T, ChannelError>
Block for an incoming value from the channel associated with this receiver.
Returns an error if all senders have been dropped or the deadline is reached.
Sourcepub fn recv_blocking(&mut self) -> Result<T, ChannelError>
pub fn recv_blocking(&mut self) -> Result<T, ChannelError>
Block for an incoming value from the channel associated with this receiver.
Sourcepub fn recv_deadline_blocking(
&mut self,
deadline: impl Into<Deadline>,
) -> Result<T, ChannelError>
pub fn recv_deadline_blocking( &mut self, deadline: impl Into<Deadline>, ) -> Result<T, ChannelError>
Block for an incoming value from the channel associated with this receiver.
Returns an error if all senders have been dropped or the deadline is reached.
Sourcepub fn iter(&mut self) -> impl Iterator<Item = T>
pub fn iter(&mut self) -> impl Iterator<Item = T>
Create a blocking iterator that receives until a channel error.
Sourcepub fn try_recv(&mut self) -> Result<Option<T>, ChannelError>
pub fn try_recv(&mut self) -> Result<Option<T>, ChannelError>
Returns the next incoming message in the channel or None.
Source§impl<T: IpcValue> IpcReceiver<T>
impl<T: IpcValue> IpcReceiver<T>
Sourcepub fn connect(ipc_sender_name: impl Into<String>) -> Result<Self, ChannelError>
pub fn connect(ipc_sender_name: impl Into<String>) -> Result<Self, ChannelError>
Connect with a named sender created in another process with NamedIpcSender.
This must only be called once for the ipc_sender_name.
Trait Implementations§
Source§impl<T: IpcValue> Debug for IpcReceiver<T>
impl<T: IpcValue> Debug for IpcReceiver<T>
Source§impl<'de, T: IpcValue> Deserialize<'de> for IpcReceiver<T>
impl<'de, T: IpcValue> Deserialize<'de> for IpcReceiver<T>
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Auto Trait Implementations§
impl<T> !Freeze for IpcReceiver<T>
impl<T> !RefUnwindSafe for IpcReceiver<T>
impl<T> Send for IpcReceiver<T>where
T: Send,
impl<T> !Sync for IpcReceiver<T>
impl<T> Unpin for IpcReceiver<T>where
T: Unpin,
impl<T> UnwindSafe for IpcReceiver<T>where
T: UnwindSafe,
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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