pub trait Shard:
Send
+ Sync
+ 'static {
// Required methods
fn id(&self) -> ShardId;
fn render<'cx>(&'cx self, cx: &'cx Cx, body: Body) -> ShardFuture<'cx>;
}Available on crate feature
router only.Expand description
A component that re-renders on the server when its runtime expression arguments change.
Registered into a RouterBuilder with
shard, which serves it as a route
dispatched by ShardId.
Required Methods§
Sourcefn render<'cx>(&'cx self, cx: &'cx Cx, body: Body) -> ShardFuture<'cx>
fn render<'cx>(&'cx self, cx: &'cx Cx, body: Body) -> ShardFuture<'cx>
Renders the shard for an endpoint request, deserializing its arguments
from body.
Trait Implementations§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".