Skip to main content

Read

Trait Read 

Source
pub trait Read<R: Resource<Self>>: Storage<R> {
    // Required method
    fn get(
        &self,
        id: &str,
    ) -> impl Future<Output = Result<Option<R>, Self::Error>> + Send;
}
Available on crate features http and validation only.
Expand description

GET /resource/{id} — fetch one row.

Implement it only if you route READ.

Required Methods§

Source

fn get( &self, id: &str, ) -> impl Future<Output = Result<Option<R>, Self::Error>> + Send

Fetch one row by id. None becomes a 404.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§