pub struct Router { /* private fields */ }Expand description
A running router instance.
Implementations§
Source§impl Router
impl Router
Sourcepub fn start(config: &RouterConfig) -> Result<Self>
pub fn start(config: &RouterConfig) -> Result<Self>
Builds and starts a router from config (byte-only — no type shapes).
§Errors
RoutingError on validation failure, an unresolved type name, an
unsupported option, or a DDS runtime error.
Sourcepub fn start_with_types(
config: &RouterConfig,
shapes: TypeRegistry,
) -> Result<Self>
pub fn start_with_types( config: &RouterConfig, shapes: TypeRegistry, ) -> Result<Self>
Like start but with a TypeRegistry supplying the
type shapes content filtering and field transformation need. Routes
without a filter/transform forward bytes verbatim and ignore the
registry; routes with a filter/transform require their input and output
types to be present.
§Errors
RoutingError as for start, plus a missing type
shape for a filtering/transforming route.
Sourcepub fn route_names(&self) -> Vec<String>
pub fn route_names(&self) -> Vec<String>
Names of the active routes.
Sourcepub fn route_metrics(&self, route: &str) -> Option<RouteMetricsSnapshot>
pub fn route_metrics(&self, route: &str) -> Option<RouteMetricsSnapshot>
Metrics snapshot for a route, or None if no such route.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Router
impl !UnwindSafe for Router
impl Freeze for Router
impl Send for Router
impl Sync for Router
impl Unpin for Router
impl UnsafeUnpin for Router
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