pub struct P2mHandler<P2mApi> { /* private fields */ }Expand description
gRPC server router that handles incoming requests and routes them to appropriate services.
Trace2eRouter implements the gRPC server-side logic by accepting incoming
requests and routing them to the appropriate process-to-middleware (P2M) or
machine-to-machine (M2M) service handlers.
§Type Parameters
P2mApi- Service handling process-to-middleware requestsM2mApi- Service handling machine-to-machine requests
§Request Routing
The router translates incoming Protocol Buffer requests to internal API types, calls the appropriate service, and converts responses back to Protocol Buffer format for transmission.
Implementations§
Trait Implementations§
Source§impl<P2mApi> P2m for P2mHandler<P2mApi>where
P2mApi: Service<P2mRequest, Response = P2mResponse, Error = TraceabilityError> + Clone + Sync + Send + 'static,
P2mApi::Future: Send,
Implementation of the trace2e gRPC service protocol.
impl<P2mApi> P2m for P2mHandler<P2mApi>where
P2mApi: Service<P2mRequest, Response = P2mResponse, Error = TraceabilityError> + Clone + Sync + Send + 'static,
P2mApi::Future: Send,
Implementation of the trace2e gRPC service protocol.
This implementation provides the server-side handlers for all gRPC endpoints defined in the trace2e protocol. It handles both P2M (process-to-middleware) and M2M (machine-to-machine) operations by delegating to the appropriate internal service handlers.
Source§fn p2m_local_enroll<'life0, 'async_trait>(
&'life0 self,
request: Request<LocalCt>,
) -> Pin<Box<dyn Future<Output = Result<Response<Ack>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn p2m_local_enroll<'life0, 'async_trait>(
&'life0 self,
request: Request<LocalCt>,
) -> Pin<Box<dyn Future<Output = Result<Response<Ack>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handles local process enrollment requests.
Registers a local file descriptor with the middleware for tracking. This is called when a process opens a local file or resource.
Source§fn p2m_remote_enroll<'life0, 'async_trait>(
&'life0 self,
request: Request<RemoteCt>,
) -> Pin<Box<dyn Future<Output = Result<Response<Ack>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn p2m_remote_enroll<'life0, 'async_trait>(
&'life0 self,
request: Request<RemoteCt>,
) -> Pin<Box<dyn Future<Output = Result<Response<Ack>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handles remote process enrollment requests.
Registers a network connection (socket) with the middleware for tracking. This is called when a process establishes a network connection.
Source§fn p2m_io_request<'life0, 'async_trait>(
&'life0 self,
request: Request<IoInfo>,
) -> Pin<Box<dyn Future<Output = Result<Response<Grant>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn p2m_io_request<'life0, 'async_trait>(
&'life0 self,
request: Request<IoInfo>,
) -> Pin<Box<dyn Future<Output = Result<Response<Grant>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handles I/O authorization requests from processes.
Evaluates whether a process is authorized to perform an I/O operation on a specific file descriptor. Returns a grant ID if authorized.
Source§fn p2m_io_report<'life0, 'async_trait>(
&'life0 self,
request: Request<IoResult>,
) -> Pin<Box<dyn Future<Output = Result<Response<Ack>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn p2m_io_report<'life0, 'async_trait>(
&'life0 self,
request: Request<IoResult>,
) -> Pin<Box<dyn Future<Output = Result<Response<Ack>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handles I/O operation completion reports from processes.
Records the completion and result of an I/O operation that was previously authorized. This completes the audit trail for the operation.
Auto Trait Implementations§
impl<P2mApi> Freeze for P2mHandler<P2mApi>where
P2mApi: Freeze,
impl<P2mApi> RefUnwindSafe for P2mHandler<P2mApi>where
P2mApi: RefUnwindSafe,
impl<P2mApi> Send for P2mHandler<P2mApi>where
P2mApi: Send,
impl<P2mApi> Sync for P2mHandler<P2mApi>where
P2mApi: Sync,
impl<P2mApi> Unpin for P2mHandler<P2mApi>where
P2mApi: Unpin,
impl<P2mApi> UnwindSafe for P2mHandler<P2mApi>where
P2mApi: UnwindSafe,
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].