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> IpcReceiver<T>where
T: IpcValue,
impl<T> IpcReceiver<T>where
T: IpcValue,
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> IpcReceiver<T>where
T: IpcValue,
impl<T> IpcReceiver<T>where
T: IpcValue,
Sourcepub fn connect(
ipc_sender_name: impl Into<String>,
) -> Result<IpcReceiver<T>, ChannelError>
pub fn connect( ipc_sender_name: impl Into<String>, ) -> Result<IpcReceiver<T>, 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> Debug for IpcReceiver<T>where
T: IpcValue,
impl<T> Debug for IpcReceiver<T>where
T: IpcValue,
Source§impl<'de, T> Deserialize<'de> for IpcReceiver<T>where
T: IpcValue,
impl<'de, T> Deserialize<'de> for IpcReceiver<T>where
T: IpcValue,
Source§fn deserialize<D>(
deserializer: D,
) -> Result<IpcReceiver<T>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<IpcReceiver<T>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Source§impl<T> Serialize for IpcReceiver<T>where
T: IpcValue,
impl<T> Serialize for IpcReceiver<T>where
T: IpcValue,
Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§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