Skip to main content

Hydrate

Trait Hydrate 

Source
pub trait Hydrate: Sized {
    // Required method
    fn hydrate<'async_trait>(
        client: Arc<Client>,
    ) -> Pin<Box<dyn Future<Output = Self> + Send + 'async_trait>>
       where Self: 'async_trait;
}
Expand description

Loading domain objects from PostgreSQL.

Complements Schema and Streamable to enable round-trip persistence. While those traits handle writing, Hydrate handles reading data back into memory.

Required Methods§

Source

fn hydrate<'async_trait>( client: Arc<Client>, ) -> Pin<Box<dyn Future<Output = Self> + Send + 'async_trait>>
where Self: 'async_trait,

Loads this type from the database.

Takes an Arc<Client> to allow the implementation to spawn concurrent queries if needed.

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§