mlx_rs/builder.rs
1//! Defines helper traits for builder pattern
2
3/// Helper trait for buildable types
4pub trait Buildable: Sized {
5 /// The builder type for this buildable type
6 type Builder: Builder<Self>;
7}
8
9/// Helper trait for builder
10pub trait Builder<T: Buildable> {
11 /// Error with building
12 type Error: std::error::Error;
13
14 /// Build the type
15 fn build(self) -> Result<T, Self::Error>;
16}