pub struct Gateway { /* private fields */ }Expand description
Connectivity boundary for one or more procs.
Implementations§
Source§impl Gateway
impl Gateway
Sourcepub fn default_location(&self) -> Location
pub fn default_location(&self) -> Location
The gateway’s default advertised location.
Sourcepub fn set_default_location(&self, location: Location)
pub fn set_default_location(&self, location: Location)
Set the gateway’s default advertised location.
Sourcepub fn proc_addr(&self, proc_id: &ProcId) -> ProcAddr
pub fn proc_addr(&self, proc_id: &ProcId) -> ProcAddr
Construct a routeable proc address using this gateway’s default location.
Sourcepub fn serve(
&self,
addr: ChannelAddr,
) -> Result<GatewayServeHandle, ChannelError>
pub fn serve( &self, addr: ChannelAddr, ) -> Result<GatewayServeHandle, ChannelError>
Serve this gateway on the provided channel address.
When serving the first local ChannelAddr::any address, the gateway
binds the local address that was reserved when the gateway was created.
Local reservation is separate from local binding so a gateway can have a
stable location before it has a runtime available to run a server.
Later local any serves allocate fresh local ports, so the gateway can
have multiple active local servers.
Serving updates the gateway’s default location to the newly served address. When that server stops, the default location falls back to the previous active server, or to the reserved fallback location when no server remains.
Trait Implementations§
Source§impl MailboxSender for Gateway
impl MailboxSender for Gateway
Source§fn post_unchecked(
&self,
envelope: MessageEnvelope,
return_handle: PortHandle<Undeliverable<MessageEnvelope>>,
)
fn post_unchecked( &self, envelope: MessageEnvelope, return_handle: PortHandle<Undeliverable<MessageEnvelope>>, )
Source§fn flush<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn flush<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
post is synchronous (e.g. local in-process delivery).Source§fn post(
&self,
envelope: MessageEnvelope,
return_handle: PortHandle<Undeliverable<MessageEnvelope>>,
)
fn post( &self, envelope: MessageEnvelope, return_handle: PortHandle<Undeliverable<MessageEnvelope>>, )
Auto Trait Implementations§
impl Freeze for Gateway
impl !RefUnwindSafe for Gateway
impl Send for Gateway
impl Sync for Gateway
impl Unpin for Gateway
impl UnsafeUnpin for Gateway
impl !UnwindSafe for Gateway
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> BoxableMailboxSender for Twhere
T: MailboxSender + Clone + 'static,
impl<T> BoxableMailboxSender for Twhere
T: MailboxSender + Clone + 'static,
Source§fn boxed(&self) -> BoxedMailboxSender
fn boxed(&self) -> BoxedMailboxSender
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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> IntoBoxedMailboxSender for Twhere
T: MailboxSender + 'static,
impl<T> IntoBoxedMailboxSender for Twhere
T: MailboxSender + 'static,
Source§fn into_boxed(self) -> BoxedMailboxSender
fn into_boxed(self) -> BoxedMailboxSender
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].