pub struct Trace2eRouter<P2mApi, M2mApi> { /* 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, M2mApi> Trace2eGrpc for Trace2eRouter<P2mApi, M2mApi>where
P2mApi: Service<P2mRequest, Response = P2mResponse, Error = TraceabilityError> + Clone + Sync + Send + 'static,
P2mApi::Future: Send,
M2mApi: Service<M2mRequest, Response = M2mResponse, Error = TraceabilityError> + Clone + Sync + Send + 'static,
M2mApi::Future: Send,
Implementation of the trace2e gRPC service protocol.
impl<P2mApi, M2mApi> Trace2eGrpc for Trace2eRouter<P2mApi, M2mApi>where
P2mApi: Service<P2mRequest, Response = P2mResponse, Error = TraceabilityError> + Clone + Sync + Send + 'static,
P2mApi::Future: Send,
M2mApi: Service<M2mRequest, Response = M2mResponse, Error = TraceabilityError> + Clone + Sync + Send + 'static,
M2mApi::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.
Source§fn m2m_destination_compliance<'life0, 'async_trait>(
&'life0 self,
request: Request<GetDestinationCompliance>,
) -> Pin<Box<dyn Future<Output = Result<Response<DestinationCompliance>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn m2m_destination_compliance<'life0, 'async_trait>(
&'life0 self,
request: Request<GetDestinationCompliance>,
) -> Pin<Box<dyn Future<Output = Result<Response<DestinationCompliance>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handles destination compliance policy requests from remote middleware.
Returns the compliance policy for a destination resource to enable remote middleware instances to evaluate flow authorization.
Source§fn m2m_source_compliance<'life0, 'async_trait>(
&'life0 self,
request: Request<GetSourceCompliance>,
) -> Pin<Box<dyn Future<Output = Result<Response<SourceCompliance>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn m2m_source_compliance<'life0, 'async_trait>(
&'life0 self,
request: Request<GetSourceCompliance>,
) -> Pin<Box<dyn Future<Output = Result<Response<SourceCompliance>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handles source compliance policy requests from remote middleware.
Returns the compliance policies for a set of source resources to enable distributed flow evaluation across multiple middleware instances.
Source§fn m2m_update_provenance<'life0, 'async_trait>(
&'life0 self,
request: Request<UpdateProvenance>,
) -> Pin<Box<dyn Future<Output = Result<Response<Ack>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn m2m_update_provenance<'life0, 'async_trait>(
&'life0 self,
request: Request<UpdateProvenance>,
) -> Pin<Box<dyn Future<Output = Result<Response<Ack>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handles provenance update requests from remote middleware.
Updates the provenance information for a destination resource based on data flows from remote sources. This maintains the audit trail across distributed operations.
Auto Trait Implementations§
impl<P2mApi, M2mApi> Freeze for Trace2eRouter<P2mApi, M2mApi>
impl<P2mApi, M2mApi> RefUnwindSafe for Trace2eRouter<P2mApi, M2mApi>where
P2mApi: RefUnwindSafe,
M2mApi: RefUnwindSafe,
impl<P2mApi, M2mApi> Send for Trace2eRouter<P2mApi, M2mApi>
impl<P2mApi, M2mApi> Sync for Trace2eRouter<P2mApi, M2mApi>
impl<P2mApi, M2mApi> Unpin for Trace2eRouter<P2mApi, M2mApi>
impl<P2mApi, M2mApi> UnwindSafe for Trace2eRouter<P2mApi, M2mApi>where
P2mApi: UnwindSafe,
M2mApi: 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
].