pub trait Handler {
// Required methods
fn read(
&self,
ctx: impl ReadContext,
reply: impl ReadReply,
) -> Result<(), Error>;
fn bump_dataver(&self, ctx: impl MatchContext);
// Provided methods
fn write(&self, _ctx: impl WriteContext) -> Result<(), Error> { ... }
fn invoke(
&self,
_ctx: impl InvokeContext,
_reply: impl InvokeReply,
) -> Result<(), Error> { ... }
fn run(
&self,
_ctx: impl HandlerContext,
) -> impl Future<Output = Result<(), Error>> { ... }
}Expand description
A version of the AsyncHandler trait that never awaits any operation.
Prefer this trait when implementing handlers that are known to be non-blocking and additionally,
mark those with NonBlockingHandler.
Required Methods§
Sourcefn read(
&self,
ctx: impl ReadContext,
reply: impl ReadReply,
) -> Result<(), Error>
fn read( &self, ctx: impl ReadContext, reply: impl ReadReply, ) -> Result<(), Error>
Read from the requested attribute and encode the result using the provided reply type.
Sourcefn bump_dataver(&self, ctx: impl MatchContext)
fn bump_dataver(&self, ctx: impl MatchContext)
Bump the per-cluster Dataver for the cluster handler matching
the supplied context endpoint_id / cluster_id.
Provided Methods§
Sourcefn write(&self, _ctx: impl WriteContext) -> Result<(), Error>
fn write(&self, _ctx: impl WriteContext) -> Result<(), Error>
Write into the requested attribute using the provided data.
Sourcefn invoke(
&self,
_ctx: impl InvokeContext,
_reply: impl InvokeReply,
) -> Result<(), Error>
fn invoke( &self, _ctx: impl InvokeContext, _reply: impl InvokeReply, ) -> Result<(), Error>
Invoke the requested command with the provided data and encode the result using the provided reply type.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".