Skip to main content

ShmTransport

Struct ShmTransport 

Source
pub struct ShmTransport { /* private fields */ }
Expand description

The shared memory transport of one participant.

Implementations§

Source§

impl ShmTransport

Source

pub fn open( config: &ShmConfig, prefix: GuidPrefix, sink: impl Into<Sink>, ) -> Result<ShmTransport>

Creates the receive segment and socket of the participant prefix and starts receiving: the messages go to sink (a Sink, or the sender of a queue), as datagrams of the unicast channels.

Source

pub fn metatraffic_locator(&self) -> Locator

The locator of the metatraffic.

Source

pub fn user_locator(&self) -> Locator

The locator of the user traffic.

Source

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.

Source

pub fn reaches(&self, locators: &[Locator]) -> bool

Whether one of a peer’s locators can be sent to by shared memory.

Source

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.

Source

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).

Source

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.

Trait Implementations§

Source§

impl Debug for ShmTransport

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Drop for ShmTransport

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

§

impl !Freeze for ShmTransport

§

impl !RefUnwindSafe for ShmTransport

§

impl !UnwindSafe for ShmTransport

§

impl Forget for ShmTransport

§

impl Move for ShmTransport

§

impl Send for ShmTransport
where RawVecInner: Send, Mutex<HashMap<u64, Option<Arc<Peer>>>>: Send, Arc<Pools>: Send, I32NotAllOnes: Send, Arc<Atomic<bool>>: Send, JoinHandle<()>: Send,

§

impl Sync for ShmTransport
where RawVecInner: Sync, Mutex<HashMap<u64, Option<Arc<Peer>>>>: Sync, Arc<Pools>: Sync, I32NotAllOnes: Sync, Arc<Atomic<bool>>: Sync, JoinHandle<()>: Sync,

§

impl Unpin for ShmTransport
where *const u8 is !null: Unpin, Align4<u32>: Unpin, Align1<u8>: Unpin, Arc<Peer>: Unpin, Arc<Pools>: Unpin, I32NotAllOnes: Unpin, Arc<Atomic<bool>>: Unpin, Arc<Inner, System>: Unpin, Arc<Packet<'static, ()>>: Unpin,

§

impl UnsafeUnpin for ShmTransport
where *const u8 is !null: UnsafeUnpin, PhantomData<u8>: UnsafeUnpin, Align4<u32>: UnsafeUnpin, Align1<u8>: UnsafeUnpin, PhantomData<(u64, Option<Arc<Peer>>)>: UnsafeUnpin, *const ArcInner<Pools> is !null: UnsafeUnpin, PhantomData<ArcInner<Pools>>: UnsafeUnpin, I32NotAllOnes: UnsafeUnpin, *const ArcInner<Atomic<bool>> is !null: UnsafeUnpin, PhantomData<ArcInner<Atomic<bool>>>: UnsafeUnpin, *const ArcInner<Inner> is !null: UnsafeUnpin, PhantomData<ArcInner<Inner>>: UnsafeUnpin, *const ArcInner<Packet<'static, ()>> is !null: UnsafeUnpin, PhantomData<ArcInner<Packet<'static, ()>>>: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.