pub struct PortRef<M> { /* private fields */ }Expand description
A reference to a remote port. All messages passed through PortRefs will be serialized. PortRefs are always streaming.
Implementations§
Source§impl<M: RemoteMessage> PortRef<M>
impl<M: RemoteMessage> PortRef<M>
Sourcepub fn attest(port_addr: PortAddr) -> Self
pub fn attest(port_addr: PortAddr) -> Self
The caller attests that the provided port address identifies a
reachable typed port for message type M.
Sourcepub fn attest_reducible(
port_addr: PortAddr,
reducer_spec: Option<ReducerSpec>,
streaming_opts: StreamingReducerOpts,
) -> Self
pub fn attest_reducible( port_addr: PortAddr, reducer_spec: Option<ReducerSpec>, streaming_opts: StreamingReducerOpts, ) -> Self
The caller attests that the provided port address identifies a
reachable typed port for message type M.
Sourcepub fn attest_handler_port(actor: &ActorAddr) -> Self
pub fn attest_handler_port(actor: &ActorAddr) -> Self
The caller attests that the provided actor exposes a reachable handler
port for message type M.
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_addr(self) -> PortAddr
pub fn into_port_addr(self) -> PortAddr
Convert this PortRef into its corresponding port address.
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 post_serialized(&self, cx: &impl Actor, headers: Flattrs, message: Any)
pub fn post_serialized(&self, cx: &impl Actor, headers: Flattrs, message: Any)
Post a serialized message to this port, provided a sending capability, such as
[crate::actor::Instance].
Sourcepub fn into_sink<C: Actor>(self, cx: C) -> PortSink<C, M>
pub fn into_sink<C: Actor>(self, cx: C) -> PortSink<C, M>
Convert this port into a sink that can be used to send messages using the given capability.
Sourcepub fn get_return_undeliverable(&self) -> bool
pub fn get_return_undeliverable(&self) -> bool
Get whether or not messages sent to this port that are undeliverable should be returned to the sender.
Sourcepub fn return_undeliverable(&mut self, return_undeliverable: bool)
pub fn return_undeliverable(&mut self, return_undeliverable: bool)
Set whether or not messages sent to this port that are undeliverable should be returned to the sender.
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> Deserialize<'de> for PortRef<M>
impl<'de, M> 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> Endpoint<M> for &PortRef<M>where
M: RemoteMessage,
impl<M> Endpoint<M> for &PortRef<M>where
M: RemoteMessage,
Source§fn endpoint_location(&self) -> EndpointLocation
fn endpoint_location(&self) -> EndpointLocation
Source§impl<M: RemoteMessage> From<&PortRef<M>> for UnboundPort
impl<M: RemoteMessage> From<&PortRef<M>> for UnboundPort
Source§impl<M: Named> Named for PortRef<M>
impl<M: 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> Ord for PortRef<M>
impl<M> Ord for PortRef<M>
Source§impl<M> PartialOrd for PortRef<M>
impl<M> PartialOrd for PortRef<M>
Source§impl<M> RemoteEndpoint<M> for &PortRef<M>where
M: RemoteMessage,
impl<M> RemoteEndpoint<M> for &PortRef<M>where
M: RemoteMessage,
Source§impl<M: RemoteMessage> Unbind for PortRef<M>
impl<M: RemoteMessage> Unbind for PortRef<M>
impl<M> 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>where
M: Send,
impl<M> Sync for PortRef<M>where
M: Sync,
impl<M> Unpin for PortRef<M>where
M: Unpin,
impl<M> UnsafeUnpin for PortRef<M>
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> 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<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<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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].