pub struct PortRef<M: RemoteMessage> { /* private fields */ }
Expand description
A reference to a remote port. All messages passed through PortRefs will be serialized.
Implementations§
Source§impl<M: RemoteMessage> PortRef<M>
impl<M: RemoteMessage> PortRef<M>
Sourcepub fn attest(port_id: PortId) -> Self
pub fn attest(port_id: PortId) -> Self
The caller attests that the provided PortId can be converted to a reachable, typed port reference.
Sourcepub fn attest_reducible(
port_id: PortId,
reducer_spec: Option<ReducerSpec>,
) -> Self
pub fn attest_reducible( port_id: PortId, reducer_spec: Option<ReducerSpec>, ) -> Self
The caller attests that the provided PortId can be converted to a reachable, typed port reference.
Sourcepub fn attest_message_port(actor: &ActorId) -> Self
pub fn attest_message_port(actor: &ActorId) -> Self
The caller attests that the provided PortId can be converted to a reachable, typed port reference.
Sourcepub fn reducer_spec(&self) -> &Option<ReducerSpec>
pub fn reducer_spec(&self) -> &Option<ReducerSpec>
The typehash of this port’s reducer, if any. Reducers may be used to coalesce messages sent to a port.
Sourcepub fn into_port_id(self) -> PortId
pub fn into_port_id(self) -> PortId
Convert this PortRef into its corresponding port id.
Sourcepub fn into_once(self) -> OncePortRef<M>
pub fn into_once(self) -> OncePortRef<M>
coerce it into OncePortRef so we can send messages to this port from APIs requires OncePortRef.
Sourcepub fn send(
&self,
caps: &impl CanSend,
message: M,
) -> Result<(), MailboxSenderError>
pub fn send( &self, caps: &impl CanSend, message: M, ) -> Result<(), MailboxSenderError>
Send a message to this port, provided a sending capability, such as
[crate::actor::Instance
].
Sourcepub fn send_with_headers(
&self,
caps: &impl CanSend,
headers: Attrs,
message: M,
) -> Result<(), MailboxSenderError>
pub fn send_with_headers( &self, caps: &impl CanSend, headers: Attrs, message: M, ) -> Result<(), MailboxSenderError>
Send a message to this port, provided a sending capability, such as
[crate::actor::Instance
]. Additional context can be provided in the form of
headers.
Sourcepub fn send_serialized(
&self,
caps: &impl CanSend,
message: Serialized,
headers: Attrs,
)
pub fn send_serialized( &self, caps: &impl CanSend, message: Serialized, headers: Attrs, )
Send a serialized message to this port, provided a sending capability, such as
[crate::actor::Instance
].
Trait Implementations§
Source§impl<M: RemoteMessage> Bind for PortRef<M>
impl<M: RemoteMessage> Bind for PortRef<M>
Source§impl<M: RemoteMessage> Clone for PortRef<M>
impl<M: RemoteMessage> Clone for PortRef<M>
Source§impl<'de, M: RemoteMessage> Deserialize<'de> for PortRef<M>
impl<'de, M: RemoteMessage> Deserialize<'de> for PortRef<M>
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl<M: RemoteMessage> Display for PortRef<M>
impl<M: RemoteMessage> Display for PortRef<M>
Source§impl<M: RemoteMessage> From<&PortRef<M>> for UnboundPort
impl<M: RemoteMessage> From<&PortRef<M>> for UnboundPort
Source§impl<M: RemoteMessage> Hash for PortRef<M>
impl<M: RemoteMessage> Hash for PortRef<M>
Source§impl<M: RemoteMessage + Named> Named for PortRef<M>
impl<M: RemoteMessage + Named> Named for PortRef<M>
Source§fn typename() -> &'static str
fn typename() -> &'static str
Source§fn typehash() -> u64
fn typehash() -> u64
Source§fn typeid() -> TypeId
fn typeid() -> TypeId
Source§fn port() -> u64
fn port() -> u64
Source§impl<M: RemoteMessage> Ord for PortRef<M>
impl<M: RemoteMessage> Ord for PortRef<M>
Source§impl<M: RemoteMessage> PartialEq for PortRef<M>
impl<M: RemoteMessage> PartialEq for PortRef<M>
Source§impl<M: RemoteMessage> PartialOrd for PortRef<M>
impl<M: RemoteMessage> PartialOrd for PortRef<M>
Source§impl<M: RemoteMessage> Serialize for PortRef<M>
impl<M: RemoteMessage> Serialize for PortRef<M>
Source§impl<M: RemoteMessage> Unbind for PortRef<M>
impl<M: RemoteMessage> Unbind for PortRef<M>
impl<M: RemoteMessage> Eq for PortRef<M>
Auto Trait Implementations§
impl<M> !Freeze for PortRef<M>
impl<M> RefUnwindSafe for PortRef<M>where
M: RefUnwindSafe,
impl<M> Send for PortRef<M>
impl<M> Sync for PortRef<M>
impl<M> Unpin for PortRef<M>where
M: Unpin,
impl<M> UnwindSafe for PortRef<M>where
M: 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
Source§impl<T> Checkpointable for Twhere
T: RemoteMessage + Clone,
impl<T> Checkpointable for Twhere
T: RemoteMessage + Clone,
Source§type State = T
type State = T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<A, M> Handler<IndexedErasedUnbound<M>> for A
impl<A, M> Handler<IndexedErasedUnbound<M>> for A
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more