Skip to main content

PerformReadOne

Trait PerformReadOne 

Source
pub trait PerformReadOne<A: ReadAction> {
    // Required method
    fn read_one(
        &self,
        args: &A::Arguments,
    ) -> impl Future<Output = Result<A::Response, ReadError>>;
}
Expand description

Trait indicating that a DataLayer can perform a get (single-resource) ReadAction A, returning the resource or ReadError::NotFound.

Required Methods§

Source

fn read_one( &self, args: &A::Arguments, ) -> impl Future<Output = Result<A::Response, ReadError>>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<R, A> PerformReadOne<A> for InMemoryDataLayer
where R: Resource + 'static, A: ReadAction<Output = R, Arguments = R::PrimaryKey, Response = R> + 'static,

Single PerformReadOne impl for InMemoryDataLayer that delegates to the underlying DataLayer::read by primary key.

Get-actions set Arguments = PrimaryKey and Response = Resource, so this blanket impl covers all get-actions without per-action codegen.