pub trait Repository {
type Error: Error;
type DateTime;
type BidderId: Eq + Hash;
type DemandId: Eq + Hash;
type PortfolioId: Eq + Hash;
type ProductId: Eq + Hash;
}Expand description
A base trait for defining the fundamental data- and error-types.
This trait establishes the core type system used throughout the repositories. Implementations define concrete types for identifiers, timestamps, and errors, allowing the system to work with different backends (SQL, NoSQL, etc.).
There is no requirement or material advantage to breaking this trait across multiple orthogonal traits as we have, but Rust does not allow partially implementing a trait across multiple files. By breaking this trait apart, this allows an implementation to keep the logic separated and ease development.
Required Associated Types§
Sourcetype PortfolioId: Eq + Hash
type PortfolioId: Eq + Hash
A type representing a portfolio id