pub struct MessageProcessor { /* private fields */ }Implementations§
Source§impl MessageProcessor
impl MessageProcessor
pub fn new_with_service_id(service_id: String) -> Self
Sourcepub fn new_with_server_config(
service_id: String,
deployment_name: String,
server_config: &ServerConfig,
relay_peer_publishes: bool,
) -> Self
pub fn new_with_server_config( service_id: String, deployment_name: String, server_config: &ServerConfig, relay_peer_publishes: bool, ) -> Self
Create a processor with the server strict header MAC policy from server_config.
pub fn new() -> Self
Sourcepub async fn run_server(
&self,
config: &ServerConfig,
) -> Result<CancellationToken, DataPathError>
pub async fn run_server( &self, config: &ServerConfig, ) -> Result<CancellationToken, DataPathError>
Run a data plane server using this message processor’s drain watch.
Dispatch on the configured transport happens inside slim-config via the
ServerHandler trait below. Returns a cancellation token that can be
used to stop the server task.
Sourcepub fn signal_drain(&self)
pub fn signal_drain(&self)
Signal all spawned tasks (process_stream, etc.) to begin shutting down.
Unlike [shutdown], this is synchronous: it drops the drain signal (which
notifies all drain watches) and the drain watch, but does NOT wait for the
tasks to finish. Safe to call from a synchronous Drop implementation.
pub async fn shutdown(&self) -> Result<(), DataPathError>
pub fn forwarder(&self) -> &Forwarder<Connection>
pub async fn connect( &self, client_config: ClientConfig, local: Option<SocketAddr>, remote: Option<SocketAddr>, ) -> Result<(JoinHandle<()>, u64), DataPathError>
pub fn disconnect(&self, conn: u64) -> Result<ClientConfig, DataPathError>
pub fn register_local_connection( &self, from_control_plane: bool, ) -> Result<(u64, Sender<Result<Message, Status>>, Receiver<Result<Message, Status>>), DataPathError>
pub async fn send_msg( &self, msg: Message, out_conn: u64, ) -> Result<(), DataPathError>
pub async fn process_message( &self, msg: Message, in_connection: u64, category: ConnType, ) -> Result<(), DataPathError>
pub fn subscription_table(&self) -> &SubscriptionTableImpl
pub fn connection_table(&self) -> &ConnectionTable<Connection>
Sourcepub fn service_id(&self) -> &str
pub fn service_id(&self) -> &str
The node identity used for cross-node communication.
Sourcepub fn set_peer_sync(&self, peer_sync: PeerSync)
pub fn set_peer_sync(&self, peer_sync: PeerSync)
Set the peer sync component.
Trait Implementations§
Source§impl Clone for MessageProcessor
impl Clone for MessageProcessor
Source§fn clone(&self) -> MessageProcessor
fn clone(&self) -> MessageProcessor
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl DataPlaneService for MessageProcessor
impl DataPlaneService for MessageProcessor
Source§type OpenChannelStream = Pin<Box<dyn Stream<Item = Result<Message, Status>> + Send>>
type OpenChannelStream = Pin<Box<dyn Stream<Item = Result<Message, Status>> + Send>>
Server streaming response type for the OpenChannel method.
fn open_channel<'life0, 'async_trait>(
&'life0 self,
request: Request<Streaming<Message>>,
) -> Pin<Box<dyn Future<Output = Result<Response<Self::OpenChannelStream>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§impl Debug for MessageProcessor
impl Debug for MessageProcessor
Source§impl Default for MessageProcessor
impl Default for MessageProcessor
Source§impl ServerHandler for MessageProcessor
impl ServerHandler for MessageProcessor
Source§fn grpc_routes(&self) -> Option<Routes>
fn grpc_routes(&self) -> Option<Routes>
gRPC transport: tonic
Routes bundle to install on the server.
Default None means “this handler does not support gRPC” — running
against a gRPC ServerConfig will then surface
ConfigError::HandlerMissingGrpcSupport.Source§fn on_websocket_accepted(&self) -> Option<OnAcceptedWebSocket>
fn on_websocket_accepted(&self) -> Option<OnAcceptedWebSocket>
WebSocket transport: per-connection callback invoked after a successful
upgrade. Same
None semantics as Self::grpc_routes.Auto Trait Implementations§
impl !RefUnwindSafe for MessageProcessor
impl !UnwindSafe for MessageProcessor
impl Freeze for MessageProcessor
impl Send for MessageProcessor
impl Sync for MessageProcessor
impl Unpin for MessageProcessor
impl UnsafeUnpin for MessageProcessor
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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