Struct Trace2eRouter

Source
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 requests
  • M2mApi - 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§

Source§

impl<P2mApi, M2mApi> Trace2eRouter<P2mApi, M2mApi>

Source

pub fn new(p2m: P2mApi, m2m: M2mApi) -> Self

Creates a new router with the specified service handlers.

§Arguments
  • p2m - Service for handling process-to-middleware requests
  • m2m - Service for handling machine-to-machine requests

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.

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,

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,

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,

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,

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,

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,

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,

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>
where P2mApi: Freeze, M2mApi: Freeze,

§

impl<P2mApi, M2mApi> RefUnwindSafe for Trace2eRouter<P2mApi, M2mApi>
where P2mApi: RefUnwindSafe, M2mApi: RefUnwindSafe,

§

impl<P2mApi, M2mApi> Send for Trace2eRouter<P2mApi, M2mApi>
where P2mApi: Send, M2mApi: Send,

§

impl<P2mApi, M2mApi> Sync for Trace2eRouter<P2mApi, M2mApi>
where P2mApi: Sync, M2mApi: Sync,

§

impl<P2mApi, M2mApi> Unpin for Trace2eRouter<P2mApi, M2mApi>
where P2mApi: Unpin, M2mApi: Unpin,

§

impl<P2mApi, M2mApi> UnwindSafe for Trace2eRouter<P2mApi, M2mApi>
where P2mApi: UnwindSafe, M2mApi: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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

§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

impl<L> LayerExt<L> for L

§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in [Layered].
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more