pub struct EstablishedRecipient<P>{ /* private fields */ }Expand description
Inert capability for one exact installed incarnation of protocol P.
The endpoint type is selected by P::Addr, so P remains the only
protocol identity and ordinary domain types carry no endpoint parameter.
The endpoint has no direct accessor or send method. It crosses only an
explicit interpretation boundary. That boundary is public and therefore a
deliberate power-user authority boundary, not exclusive runtime authority.
ⓘ
use behavior::{Address, EndpointAddress, EstablishedRecipient, Protocol};
#[derive(Clone, Copy, PartialEq, Eq)]
struct RuntimeAddr(u64);
impl Address for RuntimeAddr { type Nonce = u64; }
struct Worker;
impl Protocol for Worker { type Addr = RuntimeAddr; type Msg = (); }
#[derive(Clone)]
struct Endpoint;
impl EndpointAddress for RuntimeAddr {
type Established<P> = Endpoint where P: Protocol<Addr = Self>;
}
let recipient = EstablishedRecipient::<Worker>::issued(Endpoint);
let _endpoint = recipient.endpoint();Implementations§
Source§impl<P> EstablishedRecipient<P>
impl<P> EstablishedRecipient<P>
Sourcepub const fn issued(
endpoint: <P::Addr as EndpointAddress>::Established<P>,
) -> Self
pub const fn issued( endpoint: <P::Addr as EndpointAddress>::Established<P>, ) -> Self
Issue a capability from an endpoint already established by an interpreter.
This constructor performs no allocation or validation. Callers at this power-user boundary must issue it only after successful fresh installation and commit.
Sourcepub fn interpret<I>(self, interpreter: &mut I) -> I::Outputwhere
I: InterpretEstablished<P>,
pub fn interpret<I>(self, interpreter: &mut I) -> I::Outputwhere
I: InterpretEstablished<P>,
Transfer the endpoint through an explicit interpretation boundary.
Trait Implementations§
Source§impl<P> Clone for EstablishedRecipient<P>
impl<P> Clone for EstablishedRecipient<P>
Source§impl<P> Debug for EstablishedRecipient<P>
impl<P> Debug for EstablishedRecipient<P>
impl<P> Eq for EstablishedRecipient<P>
Source§impl<P> PartialEq for EstablishedRecipient<P>where
P: Protocol,
P::Addr: EndpointAddress,
<P::Addr as EndpointAddress>::Established<P>: PartialEq,
impl<P> PartialEq for EstablishedRecipient<P>where
P: Protocol,
P::Addr: EndpointAddress,
<P::Addr as EndpointAddress>::Established<P>: PartialEq,
Auto Trait Implementations§
impl<P> Freeze for EstablishedRecipient<P>where
<P as Protocol>::Addr: Sized,
<<P as Protocol>::Addr as EndpointAddress>::Established<P>: Freeze,
impl<P> RefUnwindSafe for EstablishedRecipient<P>where
<P as Protocol>::Addr: Sized,
<<P as Protocol>::Addr as EndpointAddress>::Established<P>: RefUnwindSafe,
impl<P> Send for EstablishedRecipient<P>where
<P as Protocol>::Addr: Sized,
<<P as Protocol>::Addr as EndpointAddress>::Established<P>: Send,
impl<P> Sync for EstablishedRecipient<P>where
<P as Protocol>::Addr: Sized,
<<P as Protocol>::Addr as EndpointAddress>::Established<P>: Sync,
impl<P> Unpin for EstablishedRecipient<P>where
<P as Protocol>::Addr: Sized,
<<P as Protocol>::Addr as EndpointAddress>::Established<P>: Unpin,
impl<P> UnsafeUnpin for EstablishedRecipient<P>where
<P as Protocol>::Addr: Sized,
<<P as Protocol>::Addr as EndpointAddress>::Established<P>: UnsafeUnpin,
impl<P> UnwindSafe for EstablishedRecipient<P>where
<P as Protocol>::Addr: Sized,
<<P as Protocol>::Addr as EndpointAddress>::Established<P>: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more