|
@@ -10,12 +10,12 @@
|
|
//!
|
|
//!
|
|
//! There are three externally-facing components in microrm:
|
|
//! There are three externally-facing components in microrm:
|
|
//! - Object modelling (via the [`Datum`](schema/datum/trait.Datum.html) and
|
|
//! - Object modelling (via the [`Datum`](schema/datum/trait.Datum.html) and
|
|
-//! [`Entity`](schema/entity/trait.Entity.html) traits)
|
|
|
|
|
|
+//! [`Entity`](schema/entity/trait.Entity.html) traits)
|
|
//! - Database querying (via [`Queryable`](prelude/trait.Queryable.html),
|
|
//! - Database querying (via [`Queryable`](prelude/trait.Queryable.html),
|
|
-//! [`RelationInterface`](prelude/trait.RelationInterface.html) and
|
|
|
|
-//! [`Insertable`](prelude/trait.Insertable.html) traits)
|
|
|
|
|
|
+//! [`RelationInterface`](prelude/trait.RelationInterface.html) and
|
|
|
|
+//! [`Insertable`](prelude/trait.Insertable.html) traits)
|
|
//! - Command-line interface generation via the [`clap`](https://docs.rs/clap/latest/clap/) crate
|
|
//! - Command-line interface generation via the [`clap`](https://docs.rs/clap/latest/clap/) crate
|
|
-//! (see [`cli::Autogenerate`] and [`cli::EntityInterface`]; requires the optional crate feature `clap`)
|
|
|
|
|
|
+//! (see [`cli::Autogenerate`] and [`cli::EntityInterface`]; requires the optional crate feature `clap`)
|
|
//!
|
|
//!
|
|
//! microrm pushes the Rust type system somewhat to provide better ergonomics, so the MSRV is
|
|
//! microrm pushes the Rust type system somewhat to provide better ergonomics, so the MSRV is
|
|
//! currently 1.75. Don't be scared off by the web of traits in the `schema` module --- you should
|
|
//! currently 1.75. Don't be scared off by the web of traits in the `schema` module --- you should
|
|
@@ -102,6 +102,7 @@
|
|
//! pub cost: f64,
|
|
//! pub cost: f64,
|
|
//! }
|
|
//! }
|
|
//!
|
|
//!
|
|
|
|
+//! // define a relation between customers and orders
|
|
//! pub struct CustomerOrders;
|
|
//! pub struct CustomerOrders;
|
|
//! impl microrm::Relation for CustomerOrders {
|
|
//! impl microrm::Relation for CustomerOrders {
|
|
//! type Domain = Customer;
|
|
//! type Domain = Customer;
|
|
@@ -145,7 +146,7 @@
|
|
//!
|
|
//!
|
|
//! pub billing_address: Option<String>,
|
|
//! pub billing_address: Option<String>,
|
|
//!
|
|
//!
|
|
-//! // we'll assume for now that there's no product multiplicities
|
|
|
|
|
|
+//! // we'll assume for now that there's no product multiplicities, i.e. this is not a multiset
|
|
//! pub contents: microrm::RelationMap<Product>,
|
|
//! pub contents: microrm::RelationMap<Product>,
|
|
//! }
|
|
//! }
|
|
//!
|
|
//!
|
|
@@ -201,7 +202,7 @@
|
|
//! // process the payment for our order by updating the entity
|
|
//! // process the payment for our order by updating the entity
|
|
//! order1.order_state.as_mut().push(
|
|
//! order1.order_state.as_mut().push(
|
|
//! OrderState::PaymentReceived {
|
|
//! OrderState::PaymentReceived {
|
|
-//! confirmation: "money received in full, promise".into()
|
|
|
|
|
|
+//! confirmation: "money received in full, i promise".into()
|
|
//! }
|
|
//! }
|
|
//! );
|
|
//! );
|
|
//!
|
|
//!
|
|
@@ -213,9 +214,8 @@
|
|
//! ```
|
|
//! ```
|
|
|
|
|
|
#![warn(missing_docs)]
|
|
#![warn(missing_docs)]
|
|
-
|
|
|
|
// this requires clippy 1.78
|
|
// this requires clippy 1.78
|
|
-// #![warn(clippy::empty_docs)]
|
|
|
|
|
|
+#![warn(clippy::empty_docs)]
|
|
|
|
|
|
// to make the proc_macros work inside the microrm crate; needed for tests and the metaschema.
|
|
// to make the proc_macros work inside the microrm crate; needed for tests and the metaschema.
|
|
extern crate self as microrm;
|
|
extern crate self as microrm;
|