pub struct InboundDispatch { /* private fields */ }Expand description
Every inbound link of one scheme, compiled against the connector’s grammar.
Cheap to clone: clones share the compiled routes, so a connector can dispatch from several tasks into the same records.
Implementations§
Source§impl InboundDispatch
impl InboundDispatch
Sourcepub fn new(
db: &AimDb,
scheme: &str,
grammar: &'static dyn TopicGrammar,
) -> DbResult<Self>
pub fn new( db: &AimDb, scheme: &str, grammar: &'static dyn TopicGrammar, ) -> DbResult<Self>
Compiles every inbound link of scheme against grammar.
Rejects every link the grammar or its key cannot compile, naming the record and the resolved topic.
Sourcepub fn dispatch(&self, topic: &str, payload: &[u8])
pub fn dispatch(&self, topic: &str, payload: &[u8])
Matches topic, deserializes payload and produces into every
matching record.
Synchronous and never blocks. Ingest failures, unmatched topics, full buffers and full key tables are logged, not returned.
Sourcepub fn subscriptions(&self) -> Vec<Arc<str>>
pub fn subscriptions(&self) -> Vec<Arc<str>>
Filters to subscribe at the transport. Allocates; call it at connect time, not per message.
Sourcepub fn routes(&self) -> &[InboundRouteInfo]
pub fn routes(&self) -> &[InboundRouteInfo]
Routes, one per inbound link, for parsing per-route configuration once at build.
Sourcepub fn route_count(&self) -> usize
pub fn route_count(&self) -> usize
Number of inbound routes.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for InboundDispatch
impl !UnwindSafe for InboundDispatch
impl Freeze for InboundDispatch
impl Send for InboundDispatch
impl Sync for InboundDispatch
impl Unpin for InboundDispatch
impl UnsafeUnpin for InboundDispatch
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