pub struct LlmpSender<SP> where
    SP: ShMemProvider
{ pub id: ClientId, pub last_msg_sent: *const LlmpMsg, pub out_shmems: Vec<LlmpSharedMap<SP::ShMem>>, pub keep_pages_forever: bool, /* private fields */ }
Expand description

Sending end on a (unidirectional) sharedmap channel

Fields

id: ClientId

ID of this sender.

last_msg_sent: *const LlmpMsg

Ref to the last message this sender sent on the last page. If null, a new page (just) started.

out_shmems: Vec<LlmpSharedMap<SP::ShMem>>

A vec of page wrappers, each containing an initialized ShMem

keep_pages_forever: bool

If true, pages will never be pruned. The broker uses this feature. By keeping the message history around, new clients may join at any time in the future.

Implementations

An actor on the sending part of the shared map

Create a new LlmpSender using a given ShMemProvider, and id. If keep_pages_forever is true, ShMem will never be freed. If it is false, the pages will be unmapped once they are full, and have been mapped by at least one LlmpReceiver.

Completely reset the current sender map. Afterwards, no receiver should read from it at a different location. This is only useful if all connected llmp parties start over, for example after a crash.

Safety

Only safe if you really really restart the page on everything connected No receiver should read from this page at a different location.

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

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

Waits for this sender to be save to unmap. If a receiver is involved, this function should always be called.

If we are allowed to unmap this client

For debug purposes: Mark save to unmap, even though it might not have been read by a receiver yet.

Safety

If this method is called, the page may be unmapped before it is read by any receiver.

Reattach to a vacant out_shmem. It is essential, that the receiver (or someone else) keeps a pointer to this map else reattach will get a new, empty page, from the OS, or fail.

Allocates the next space on this sender page

Cancel send of the next message, this allows us to allocate a new message without sending this one.

Safety

They msg pointer may no longer be used after cancel_send

Shrinks the allocated LlmpMsg to a given size.

Safety

The msg pointer will be dereferenced, if it’s not null.

Allocates a message of the given size, tags it, and sends it off.

Send a buf with the given flags.

Describe this LlmpClient in a way that it can be restored later, using Self::on_existing_from_description.

Create this client on an existing map from the given description. Acquired with [self.describe].

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

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

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.