pub struct LlmpReceiver<SP>
where SP: ShMemProvider,
{ /* private fields */ }
Expand description

Receiving end on a (unidirectional) sharedmap channel

Implementations§

source§

impl<SP> LlmpReceiver<SP>
where SP: ShMemProvider,

Receiving end of an llmp channel

source

pub fn on_existing_from_env( shmem_provider: SP, env_name: &str ) -> Result<Self, Error>

Reattach to a vacant recv_shmem, to with a previous sender stored the information in an env before.

source

pub fn to_env(&self, env_name: &str) -> Result<(), Error>

Store the info to this receiver to env. A new client can reattach to it using LlmpReceiver::on_existing_from_env()

source

pub fn on_existing_shmem( shmem_provider: SP, current_sender_shmem: SP::ShMem, last_msg_recvd_offset: Option<u64> ) -> Result<Self, Error>

Create a Receiver, reattaching to an existing sender map. It is essential, that the sender (or someone else) keeps a pointer to the sender_shmem else reattach will get a new, empty page, from the OS, or fail.

source

pub unsafe fn recv_blocking(&mut self) -> Result<*mut LlmpMsg, Error>

Blocks/spins until the next message gets posted to the page, then returns that message.

Safety

Returns a raw ptr, on the recv map. Should be safe in general

source

pub fn recv_buf(&mut self) -> Result<Option<(ClientId, Tag, &[u8])>, Error>

Returns the next message, tag, buf, if available, else None

source

pub fn recv_buf_with_flags( &mut self ) -> Result<Option<(ClientId, Tag, Flags, &[u8])>, Error>

Receive the buffer, also reading the LLMP internal message flags

source

pub fn recv_buf_blocking(&mut self) -> Result<(ClientId, Tag, &[u8]), Error>

Returns the next sender, tag, buf, looping until it becomes available

source

pub fn describe(&self) -> Result<LlmpDescription, Error>

Describe this client in a way, that it can be restored later with Self::on_existing_from_description

source

pub fn on_existing_from_description( shmem_provider: SP, description: &LlmpDescription ) -> Result<Self, Error>

Create this client on an existing map from the given description. acquired with self.describe

Trait Implementations§

source§

impl<SP> Debug for LlmpReceiver<SP>
where SP: ShMemProvider + Debug, SP::ShMem: Debug,

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<SP> RefUnwindSafe for LlmpReceiver<SP>

§

impl<SP> !Send for LlmpReceiver<SP>

§

impl<SP> !Sync for LlmpReceiver<SP>

§

impl<SP> Unpin for LlmpReceiver<SP>
where SP: Unpin, <SP as ShMemProvider>::ShMem: Unpin,

§

impl<SP> UnwindSafe for LlmpReceiver<SP>

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<Tail, T> Prepend<T> for Tail

§

type PreprendResult = Tail

The Resulting TupleList, of an Prepend::prepend() call, including the prepended entry.
source§

fn prepend(self, value: T) -> (T, <Tail as Prepend<T>>::PreprendResult)

Prepend a value to this tuple, returning a new tuple with prepended value.
source§

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

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.