Struct console_subscriber::Server
source · pub struct Server { /* private fields */ }
Expand description
A gRPC Server
that implements the tokio-console
wire format.
Client applications, such as the tokio-console
CLI connect to the gRPC
server, and stream data about the runtime’s history (such as a list of the
currently active tasks, or statistics summarizing polling times). A Server
also
interprets commands from a client application, such a request to focus in on
a specific task, and translates that into a stream of details specific to
that task.
Implementations§
source§impl Server
impl Server
sourcepub const DEFAULT_IP: IpAddr = _
pub const DEFAULT_IP: IpAddr = _
A Server
by default binds socket address 127.0.0.1 to service remote
procedure calls.
Note that methods like init
and
spawn
will parse the socket address from the
TOKIO_CONSOLE_BIND
environment variable before falling back on
constructing a socket address from this default.
See also Builder::server_addr
.
sourcepub const DEFAULT_PORT: u16 = 6_669u16
pub const DEFAULT_PORT: u16 = 6_669u16
A Server
by default binds port 6669 to service remote procedure
calls.
Note that methods like init
and
spawn
will parse the socket address from the
TOKIO_CONSOLE_BIND
environment variable before falling back on
constructing a socket address from this default.
See also Builder::server_addr
.
sourcepub async fn serve(self) -> Result<(), Box<dyn Error + Send + Sync + 'static>>
pub async fn serve(self) -> Result<(), Box<dyn Error + Send + Sync + 'static>>
Starts the gRPC service with the default gRPC settings.
To configure gRPC server settings before starting the server, use
serve_with
instead. This method is equivalent to calling serve_with
and providing the default gRPC server settings:
server.serve_with(tonic::transport::Server::default()).await
sourcepub async fn serve_with(
self,
builder: Server
) -> Result<(), Box<dyn Error + Send + Sync + 'static>>
pub async fn serve_with( self, builder: Server ) -> Result<(), Box<dyn Error + Send + Sync + 'static>>
Starts the gRPC service with the given tonic
gRPC transport server
builder
.
The builder
parameter may be used to configure gRPC-specific settings
prior to starting the server.
This spawns both the server task and the event aggregation worker task on the current async runtime.
Trait Implementations§
source§impl Instrument for Server
impl Instrument for Server
§type WatchUpdatesStream = ReceiverStream<Result<Update, Status>>
type WatchUpdatesStream = ReceiverStream<Result<Update, Status>>
§type WatchTaskDetailsStream = ReceiverStream<Result<TaskDetails, Status>>
type WatchTaskDetailsStream = ReceiverStream<Result<TaskDetails, Status>>
source§fn watch_updates<'life0, 'async_trait>(
&'life0 self,
req: Request<InstrumentRequest>
) -> Pin<Box<dyn Future<Output = Result<Response<Self::WatchUpdatesStream>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn watch_updates<'life0, 'async_trait>( &'life0 self, req: Request<InstrumentRequest> ) -> Pin<Box<dyn Future<Output = Result<Response<Self::WatchUpdatesStream>, Status>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
source§fn watch_task_details<'life0, 'async_trait>(
&'life0 self,
req: Request<TaskDetailsRequest>
) -> Pin<Box<dyn Future<Output = Result<Response<Self::WatchTaskDetailsStream>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn watch_task_details<'life0, 'async_trait>( &'life0 self, req: Request<TaskDetailsRequest> ) -> Pin<Box<dyn Future<Output = Result<Response<Self::WatchTaskDetailsStream>, Status>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Auto Trait Implementations§
impl !RefUnwindSafe for Server
impl Send for Server
impl Sync for Server
impl Unpin for Server
impl !UnwindSafe for Server
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> 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>
T
in a tonic::Request