pub struct Channel { /* private fields */ }Expand description
A gRPC channel representing a connection to a server.
Implementations§
Source§impl Channel
impl Channel
Sourcepub fn builder(uri: impl Into<String>) -> ChannelBuilder
pub fn builder(uri: impl Into<String>) -> ChannelBuilder
Create a channel builder for the given URI.
Sourcepub async fn connect(uri: impl Into<String>) -> Result<Self, GrpcError>
pub async fn connect(uri: impl Into<String>) -> Result<Self, GrpcError>
Connect to a gRPC server at the given URI.
Sourcepub async fn connect_with_config(
uri: &str,
config: ChannelConfig,
) -> Result<Self, GrpcError>
pub async fn connect_with_config( uri: &str, config: ChannelConfig, ) -> Result<Self, GrpcError>
Connect with custom configuration.
Sourcepub fn config(&self) -> &ChannelConfig
pub fn config(&self) -> &ChannelConfig
Get the channel configuration.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Channel
impl RefUnwindSafe for Channel
impl Send for Channel
impl Sync for Channel
impl Unpin for Channel
impl UnsafeUnpin for Channel
impl UnwindSafe for Channel
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,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).