ibverbs_rs/network/
polling_scope.rs1use crate::channel::{PollingScope, ScopeError};
2use crate::ibverbs::protection_domain::ProtectionDomain;
3use crate::network::Node;
4
5impl Node {
6 pub fn scope<'env, F, T, E>(&'env mut self, f: F) -> Result<T, ScopeError<E>>
10 where
11 F: for<'scope> FnOnce(&mut PollingScope<'scope, 'env, Node>) -> Result<T, E>,
12 {
13 PollingScope::run(self, f)
14 }
15 pub fn manual_scope<'env, F, T, E>(&'env mut self, f: F) -> Result<T, E>
19 where
20 F: for<'scope> FnOnce(&mut PollingScope<'scope, 'env, Node>) -> Result<T, E>,
21 {
22 PollingScope::run_manual(self, f)
23 }
24}
25
26impl<'scope, 'env> PollingScope<'scope, 'env, Node> {
27 pub fn pd(&self) -> &ProtectionDomain {
29 self.inner.pd()
30 }
31
32 pub fn world_size(&self) -> usize {
34 self.inner.world_size()
35 }
36
37 pub fn rank(&self) -> usize {
39 self.inner.rank()
40 }
41}