Struct otlp_embedded::TraceServiceImpl
source · pub struct TraceServiceImpl { /* private fields */ }
Expand description
The implementation of TraceService
.
Implementations§
source§impl TraceServiceImpl
impl TraceServiceImpl
sourcepub fn new(state: Arc<RwLock<State>>) -> Self
pub fn new(state: Arc<RwLock<State>>) -> Self
Create a new TraceServiceImpl
with the given State
reference.
Examples found in repository?
examples/basic.rs (line 16)
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
async fn main() {
let state = State::new(100);
let state_clone = state.clone();
tokio::spawn(async {
axum::Server::bind(&"0.0.0.0:10188".parse().unwrap())
.serve(ui_app(state, "/").into_make_service())
.await
.unwrap();
});
tonic::transport::Server::builder()
.add_service(TraceServiceServer::new(TraceServiceImpl::new(state_clone)))
.serve("0.0.0.0:43177".parse().unwrap())
.await
.unwrap();
}
Trait Implementations§
source§impl TraceService for TraceServiceImpl
impl TraceService for TraceServiceImpl
source§fn export<'life0, 'async_trait>(
&'life0 self,
request: Request<ExportTraceServiceRequest>
) -> Pin<Box<dyn Future<Output = Result<Response<ExportTraceServiceResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn export<'life0, 'async_trait>(
&'life0 self,
request: Request<ExportTraceServiceRequest>
) -> Pin<Box<dyn Future<Output = Result<Response<ExportTraceServiceResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
For performance reasons, it is recommended to keep this RPC
alive for the entire life of the application.
Auto Trait Implementations§
impl !RefUnwindSafe for TraceServiceImpl
impl Send for TraceServiceImpl
impl Sync for TraceServiceImpl
impl Unpin for TraceServiceImpl
impl !UnwindSafe for TraceServiceImpl
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> 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