Skip to main content

RequestEndpoint

Trait RequestEndpoint 

Source
pub trait RequestEndpoint<AppState = ()> {
    const ENDPOINT_ID: &'static str;
    const POLICY: RequestEndpointPolicy;

    // Required method
    async fn handle(
        context: RequestContext<'_, AppState>,
    ) -> Result<(), Decline>;
}

Required Associated Constants§

Source

const ENDPOINT_ID: &'static str

You can use whatever string value you like (it’s hashed and truncated so the wire length will be stable), but it’s common convention to use URL/filesystem-like syntax, e.g., “/example/thing”

Source

const POLICY: RequestEndpointPolicy

Required Methods§

Source

async fn handle(context: RequestContext<'_, AppState>) -> Result<(), Decline>

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl<State, Endpoint> RequestEndpoint<State> for Endpoint
where Endpoint: RnxCommandHandler<State>,

Source§

const ENDPOINT_ID: &'static str = prns_core::rnx::COMMAND_PATH

Source§

const POLICY: RequestEndpointPolicy