pub struct GrpcConnection { /* private fields */ }Expand description
gRPC connection manager for bidirectional streaming
Implementations§
Source§impl GrpcConnection
impl GrpcConnection
Sourcepub fn new(server_address: ServerAddress) -> Self
pub fn new(server_address: ServerAddress) -> Self
Create a new gRPC connection
Sourcepub fn with_namespace(self, namespace: &str) -> Self
pub fn with_namespace(self, namespace: &str) -> Self
Set namespace
Sourcepub fn with_app_name(self, app_name: &str) -> Self
pub fn with_app_name(self, app_name: &str) -> Self
Set app name
Sourcepub fn with_labels(self, labels: HashMap<String, String>) -> Self
pub fn with_labels(self, labels: HashMap<String, String>) -> Self
Set labels
Sourcepub fn with_timeout(self, timeout_ms: u64) -> Self
pub fn with_timeout(self, timeout_ms: u64) -> Self
Set timeout
Sourcepub fn connection_id(&self) -> String
pub fn connection_id(&self) -> String
Get connection ID
Sourcepub fn state(&self) -> ConnectionState
pub fn state(&self) -> ConnectionState
Get current state
Sourcepub fn is_connected(&self) -> bool
pub fn is_connected(&self) -> bool
Check if connected
Sourcepub fn register_push_handler(
&self,
message_type: &str,
handler: ServerPushHandler,
)
pub fn register_push_handler( &self, message_type: &str, handler: ServerPushHandler, )
Register a push handler for a specific message type
Sourcepub async fn disconnect(&self)
pub async fn disconnect(&self)
Disconnect from server
Auto Trait Implementations§
impl Freeze for GrpcConnection
impl !RefUnwindSafe for GrpcConnection
impl Send for GrpcConnection
impl Sync for GrpcConnection
impl Unpin for GrpcConnection
impl !UnwindSafe for GrpcConnection
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request