pub struct Message(/* private fields */);
Expand description
Implementations§
Source§impl Message
impl Message
Sourcepub fn is_no_proc(&self) -> bool
pub fn is_no_proc(&self) -> bool
True if the Source
for the probe was the null process.
Sourcepub fn matched_receive<Msg>(self) -> (Msg, Status)where
Msg: Equivalence,
pub fn matched_receive<Msg>(self) -> (Msg, Status)where
Msg: Equivalence,
Sourcepub fn matched_receive_into<Buf>(self, buf: &mut Buf) -> Status
pub fn matched_receive_into<Buf>(self, buf: &mut Buf) -> Status
Receive a previously probed message into a Buffer
.
Receive the message &self
with contents matching buf
.
§Standard section(s)
3.8.3
Sourcepub fn immediate_matched_receive_into<'a, Sc, Buf>(
self,
scope: Sc,
buf: &'a mut Buf,
) -> Request<'a, Sc>
pub fn immediate_matched_receive_into<'a, Sc, Buf>( self, scope: Sc, buf: &'a mut Buf, ) -> Request<'a, Sc>
Asynchronously receive a previously probed message into a Buffer
.
Asynchronously receive the message &self
with contents matching buf
.
§Panics
?
§Standard section(s)
3.8.3
Examples found in repository?
examples/immediate.rs (line 51)
8fn main() {
9 let universe = mpi::initialize().unwrap();
10 let world = universe.world();
11
12 let x = std::f32::consts::PI;
13 let mut y: f32 = 0.0;
14
15 mpi::request::scope(|scope| {
16 let mut sreq = world.this_process().immediate_send(scope, &x);
17 let rreq = world.any_process().immediate_receive_into(scope, &mut y);
18 rreq.wait();
19 loop {
20 match sreq.test() {
21 Ok(_) => {
22 break;
23 }
24 Err(req) => {
25 sreq = req;
26 }
27 }
28 }
29 });
30 assert_eq!(x, y);
31
32 y = 0.0;
33 mpi::request::scope(|scope| {
34 let _rreq = WaitGuard::from(world.any_process().immediate_receive_into(scope, &mut y));
35 let _sreq = WaitGuard::from(world.this_process().immediate_ready_send(scope, &x));
36 });
37 assert_eq!(x, y);
38
39 assert!(world.any_process().immediate_probe().is_none());
40 assert!(world.any_process().immediate_matched_probe().is_none());
41
42 y = 0.0;
43 mpi::request::scope(|scope| {
44 let _sreq: WaitGuard<_> = world
45 .this_process()
46 .immediate_synchronous_send(scope, &x)
47 .into();
48 let preq = world.any_process().immediate_matched_probe();
49 assert!(preq.is_some());
50 let (msg, _) = preq.unwrap();
51 let _rreq: WaitGuard<_> = msg.immediate_matched_receive_into(scope, &mut y).into();
52 });
53 assert_eq!(x, y);
54
55 let future = world.any_process().immediate_receive();
56 world.this_process().send(&x);
57 let (msg, _) = future.get();
58 assert_eq!(x, msg);
59
60 let future = world.any_process().immediate_receive();
61 let res = future.r#try();
62 assert!(res.is_err());
63 let mut future = res.err().unwrap();
64 world.this_process().send(&x);
65 loop {
66 match future.r#try() {
67 Ok((msg, _)) => {
68 assert_eq!(x, msg);
69 break;
70 }
71 Err(f) => {
72 future = f;
73 }
74 }
75 }
76
77 mpi::request::scope(|scope| {
78 let sreq = world.this_process().immediate_send(scope, &x);
79 sreq.cancel();
80 sreq.wait();
81
82 let _sreq = CancelGuard::from(world.this_process().immediate_receive_into(scope, &mut y));
83 });
84}
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Message
impl RefUnwindSafe for Message
impl !Send for Message
impl !Sync for Message
impl Unpin for Message
impl UnwindSafe for Message
Blanket Implementations§
Source§impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
Source§fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
Convert the given value into an approximately equivalent representation.
Source§impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
Source§type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
The error type produced by a failed conversion.
Source§fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
Convert the subject into an approximately equivalent representation.
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
Source§impl<T, Dst> ConvAsUtil<Dst> for T
impl<T, Dst> ConvAsUtil<Dst> for T
Source§impl<T> ConvUtil for T
impl<T> ConvUtil for T
Source§fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
Approximate the subject to a given type with the default scheme.
Source§fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
Approximate the subject to a given type with a specific scheme.