pub struct ShmTransport { /* private fields */ }Expand description
The shared memory transport of one participant.
Implementations§
Source§impl ShmTransport
impl ShmTransport
Sourcepub fn open(
config: &ShmConfig,
prefix: GuidPrefix,
tx: Sender<Datagram>,
) -> Result<ShmTransport>
pub fn open( config: &ShmConfig, prefix: GuidPrefix, tx: Sender<Datagram>, ) -> Result<ShmTransport>
Creates the receive segment and socket of the participant prefix
and starts receiving: the messages go to tx, as datagrams of the
unicast channels.
Sourcepub fn metatraffic_locator(&self) -> Locator
pub fn metatraffic_locator(&self) -> Locator
The locator of the metatraffic.
Sourcepub fn user_locator(&self) -> Locator
pub fn user_locator(&self) -> Locator
The locator of the user traffic.
Sourcepub fn select<'a>(&self, locators: &'a [Locator]) -> Vec<&'a Locator>
pub fn select<'a>(&self, locators: &'a [Locator]) -> Vec<&'a Locator>
Of a peer’s locators, those to send to: its shared memory ones if one of them can be used, else the others.
Sourcepub fn reaches(&self, locators: &[Locator]) -> bool
pub fn reaches(&self, locators: &[Locator]) -> bool
Whether one of a peer’s locators can be sent to by shared memory.
Sourcepub fn create_pool(&self, slots: u32, slot_size: usize) -> Result<Arc<Pool>>
pub fn create_pool(&self, slots: u32, slot_size: usize) -> Result<Arc<Pool>>
A pool of slots samples of up to slot_size octets, for a
writer to lend samples from.
Sourcepub fn pools(&self) -> Arc<Pools> ⓘ
pub fn pools(&self) -> Arc<Pools> ⓘ
The pools of the samples that writers of this host send to this
participant by reference (see PoolLoan::reference).
Sourcepub fn send(&self, data: &[u8], to: &Locator) -> Result<()>
pub fn send(&self, data: &[u8], to: &Locator) -> Result<()>
Sends one message to a shared memory locator. Fails with
io::ErrorKind::WouldBlock when the peer’s buffer is full and
io::ErrorKind::Unsupported for a locator it cannot use.