Skip to main content

Shard

Trait Shard 

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

Source

fn id(&self) -> ShardId

The identity of this shard.

Source

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§

Source§

impl Collect for &'static dyn Shard

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<S: Shard + ?Sized> Shard for &'static S

Source§

fn id(&self) -> ShardId

Source§

fn render<'cx>(&'cx self, cx: &'cx Cx, body: Body) -> ShardFuture<'cx>

Implementors§