Skip to main content

ContextKind

Trait ContextKind 

Source
pub trait ContextKind {
    type View<'a>
       where Self: 'a;
}
Expand description

What one publish position hands its transforms.

A reply is published by the runtime, which still holds the delivery being answered, so a transform there can read it. A message leaving an Out slot is published by the handler body, which has already read whatever it wanted from its own Context, so there is no delivery left to hand on. The difference between the two positions is exactly this view, not two interfaces: PublishTransform takes the kind as a parameter and every position picks its own at compile time.

The set is closed - ForReply and ForSlot - and nothing below the mount site asks which one it got.

Required Associated Types§

Source

type View<'a> where Self: 'a

The view a transform of this kind reads, borrowed for the length of one publish.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl ContextKind for ForSlot

Source§

type View<'a> = SlotContext<'a> where ForSlot: 'a

Source§

impl<C> ContextKind for ForReply<C>

Source§

type View<'a> = PublishContext<'a, C> where ForReply<C>: 'a