ibverbs_rs/multi_channel/
polling_scope.rs1use crate::channel::{PollingScope, ScopeError};
2use crate::ibverbs::protection_domain::ProtectionDomain;
3use crate::multi_channel::MultiChannel;
4
5impl MultiChannel {
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, MultiChannel>) -> Result<T, E>,
12 {
13 PollingScope::run(self, f)
14 }
15
16 pub fn manual_scope<'env, F, T, E>(&'env mut self, f: F) -> Result<T, E>
20 where
21 F: for<'scope> FnOnce(&mut PollingScope<'scope, 'env, MultiChannel>) -> Result<T, E>,
22 {
23 PollingScope::run_manual(self, f)
24 }
25}
26
27impl<'scope, 'env> PollingScope<'scope, 'env, MultiChannel> {
28 pub fn pd(&self) -> &ProtectionDomain {
30 self.inner.pd()
31 }
32
33 pub fn num_channels(&self) -> usize {
35 self.inner.channels.len()
36 }
37}