Skip to main content

get_channel

Function get_channel 

Source
pub fn get_channel(endpoint: &str) -> Result<Channel, Error>
Expand description

Return a [Channel] for endpoint, reusing a cached one if it exists.

The channel is connected lazily: no network activity occurs until the first RPC is made. Keepalive settings are applied at creation time from the environment variables documented in the module-level doc.

§Errors

Returns [tonic::transport::Error] if endpoint is not a valid URI.

§Panics

Panics if called outside a Tokio runtime context (required by tonic’s transport layer).