pub enum Transport {
Mtls {
endpoint: String,
ca_cert: String,
client_cert: String,
client_key: String,
auth_token: Option<String>,
expected_worker_identity: String,
},
Sidecar {
endpoint: String,
auth_token: Option<String>,
},
}Expand description
Runtime transport configuration (derived from the manifest).
Variants§
Implementations§
Source§impl Transport
impl Transport
Sourcepub async fn connect(
&self,
connect_timeout: Duration,
) -> Result<Channel, TransportError>
pub async fn connect( &self, connect_timeout: Duration, ) -> Result<Channel, TransportError>
Create a gRPC channel for this transport, failing fast at startup.
connect_timeout bounds the initial connection/handshake.
§Errors
Returns a TransportError if certificates cannot be read, the endpoint
or TLS configuration is malformed, the server identity does not match, or
the connection fails.
Sourcepub fn auth_token(&self) -> Option<&str>
pub fn auth_token(&self) -> Option<&str>
The configured auth token, if any.
Sourcepub fn worker_identity(&self) -> Option<&str>
pub fn worker_identity(&self) -> Option<&str>
The expected worker identity for mTLS transports (for audit logging).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Transport
impl RefUnwindSafe for Transport
impl Send for Transport
impl Sync for Transport
impl Unpin for Transport
impl UnwindSafe for Transport
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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>
Converts
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>
Converts
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>
Wrap the input message
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>,
Applies the layer to a service and wraps it in [
Layered].