Skip to content

Commit 4fb3de5

Browse files
committed
Fixed most documentation
1 parent a106ab6 commit 4fb3de5

18 files changed

+22
-29
lines changed

rorm-db

src/conditions/collections.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ pub enum CollectionOperator {
7474
///
7575
/// ## Disadvantage:
7676
/// - All conditions have to be of the same type.
77-
/// This can be mitigated by erasing their type using [Condition::boxed].
78-
/// In this case use [`BoxedCondition<'a>`](super::BoxedCondition) for the generic variable `T`.
77+
/// This can be mitigated by erasing their type using [`Condition::boxed`].
78+
/// In this case use [`Box<dyn Condition>`] for the generic variable `T`.
7979
#[derive(Clone)]
8080
pub struct DynamicCollection<T> {
8181
/// Operator used for joining, i.e. `and` or `or`

src/conditions/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! A high-level generic condition tree
22
//!
3-
//! It is basically a generic version of the [`rorm_db::Condition`](conditional::Condition) tree.
3+
//! It is basically a generic version of the [`rorm_sql::Condition`](rorm_db::sql::conditional::Condition) tree.
44
55
use std::borrow::Cow;
66
use std::sync::Arc;
@@ -155,7 +155,7 @@ pub enum Value<'a> {
155155
BitVec(crate::fields::types::postgres_only::BitCow<'a>),
156156
}
157157
impl Value<'_> {
158-
/// Convert into an [`sql::Value`](value::Value) instead of an [`sql::Condition`](conditional::Condition) directly.
158+
/// Convert into an [`sql::Value`](value::Value) instead of an [`sql::Condition`](rorm_db::sql::conditional::Condition) directly.
159159
pub fn as_sql(&self) -> value::Value {
160160
match self {
161161
Value::Null(null_type) => value::Value::Null(*null_type),

src/crud/decoder.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ where
169169
}
170170
}
171171

172-
/// [`Decoder`] returned by [`DecoderExt::decoder`]
172+
/// [`Decoder`] returned by [`DecoderExt::optional`]
173173
pub struct Optional<D> {
174174
decoder: D,
175175
}

src/crud/mod.rs

+1-7
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,7 @@
44
//! This means for every crud query ([INSERT](insert), [SELECT](query), [UPDATE](update), [DELETE](delete)) there exists a builder struct
55
//! whose methods allow you to set the various parameters.
66
//!
7-
//! To begin a builder it is recommended to use the associated macros [`insert!`], [`query!`], [`update!`] and [`delete!`].
8-
//! The hide some of the generic details and may run some compile time checks.
9-
//!
10-
//! [`insert!`]: macro@crate::insert
11-
//! [`query!`]: macro@crate::query
12-
//! [`update!`]: macro@crate::update
13-
//! [`delete!`]: macro@crate::delete
7+
//! To begin a builder use their associated functions [`insert`], [`query`], [`update`] and [`delete`].
148
pub mod builder;
159
pub mod decoder;
1610
pub mod delete;

src/crud/update.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ where
9696
///
9797
/// The executor to query with.
9898
///
99-
/// - `M`: [`Model`](Model)
99+
/// - `M`: [`Model`]
100100
///
101101
/// The model from whose table to update rows.
102102
///

src/fields/traits/aggregate.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use crate::fields::traits::{Array, FieldType};
1111

1212
/// Marker for [`FieldProxy::count`]
1313
///
14-
/// This is implemented for every [`SingleColumnFieldType`]
14+
/// This is implemented for every [`SingleColumnFieldType`](crate::internal::field::SingleColumnField)
1515
pub trait FieldCount: FieldType {}
1616
impl<T> FieldCount for T where T: FieldType<Columns = Array<1>> {}
1717

src/fields/traits/cmp.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
//! Also contains more traits corresponding to other sql comparison operators.
55
//!
66
//! ## Using
7-
//! Don't call the traits' methods directly. Instead use the corresponding method on [`FieldAccess`].
7+
//! Don't call the traits' methods directly. Instead use the corresponding method on [`FieldProxy`].
88
//! Otherwise the assumptions an implementation is allowed to make, might be violated.
99
//!
1010
//! ## Implementing
11-
//! - Each method takes an [`FieldAccess`]; an implementation may assume that the access' field's type
11+
//! - Each method takes an [`FieldProxy`]; an implementation may assume that the access' field's type
1212
//! matches the type the trait is implemented on. This isn't enforced using trait bounds (yet?) to reduce complexity.
1313
1414
use super::FieldType;

src/fields/types/max_str.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ where
5555
/// Returns the “default value” for a type. [Read more](Default::default)
5656
///
5757
/// # Panics
58-
/// If [`Str::default`] produces a value which is longer than `MAX_LEN`.
58+
/// If `Str::default` produces a value which is longer than `MAX_LEN`.
5959
fn default() -> Self {
6060
Self::new(Default::default())
6161
.unwrap_or_else(|_| panic!("A `Default` for a `Deref<Target = str>` should be empty"))

src/fields/utils/check.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! Re-usable implementations of [`FieldType::Check`](FieldType::Check)
1+
//! Re-usable implementations of [`FieldType::Check`]
22
33
use crate::const_fn;
44
#[cfg(doc)]

src/fields/utils/get_annotations.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! Re-usable implementations of [`FieldType::GetAnnotations`](FieldType::GetAnnotations)
1+
//! Re-usable implementations of [`FieldType::GetAnnotations`]
22
33
use crate::const_fn;
44
#[cfg(doc)]

src/fields/utils/get_names.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! Re-usable implementations of [`FieldType::GetNames`](FieldType::GetNames)
1+
//! Re-usable implementations of [`FieldType::GetNames`]
22
33
use crate::const_fn;
44
#[cfg(doc)]

src/fields/utils/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! Utility types, traits and functions required to declare and implement the [`FieldType`] trait.
1+
//! Utility types, traits and functions required to declare and implement the [`FieldType`](crate::fields::traits::FieldType) trait.
22
33
pub mod check;
44
pub mod const_fn;

src/internal/field/decoder.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use crate::fields::proxy::FieldProxyImpl;
99
use crate::internal::field::{Field, FieldProxy};
1010
use crate::internal::query_context::QueryContext;
1111

12-
/// [`Decoder`] for a single field's [`Field::Type`](Field::Type)
12+
/// [`Decoder`] for a single field's [`Field::Type`]
1313
pub trait FieldDecoder: Decoder {
1414
/// Construct decoder for a specific field and path
1515
fn new<I>(ctx: &mut QueryContext, _: FieldProxy<I>) -> Self

src/internal/hmr/annotations.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! A type level version of [`imr::Annotation`](crate::imr::Annotation)
1+
//! A type level version of [`imr::Annotation`]
22
//! to be used in generic type bound checks and a struct to store them
33
44
use rorm_declaration::{imr, lints};

src/internal/hmr/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
//! This module holds the high level model representation
22
//!
33
//! It adds:
4-
//! - [`db_type`]: a type level version of [`imr::DbType`](crate::imr::DbType) to be used in generic type bound checks
54
//! - [`annotations`]: a type level version of [`imr::Annotation`](crate::imr::Annotation) to be used in generic type bound checks
65
//!
76
//! These features are split into different submodules to avoid name conflicts.

src/internal/query_context/flat_conditions.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
//! Flat generic-less representation of a condition tree
22
//!
33
//! This representation is used inside the [`QueryContext`]
4-
//! to store a generic [`Condition`] using a concrete type
4+
//! to store a generic [`Condition`](crate::conditions::Condition) using a concrete type
55
//! before handing it over to `rorm-sql`.
66
//!
77
//! There has to be a representation in between because `rorm-sql` doesn't take ownership
8-
//! and the `Condition` [`Column`] requires generating join aliases (owned strings)
8+
//! and the `Condition` [`Column`](crate::conditions::Column) requires generating join aliases (owned strings)
99
//! after the use constructed his condition tree.
1010
1111
use crate::conditions::collections::CollectionOperator;
@@ -40,7 +40,7 @@ pub enum GetConditionError {
4040
/// Unexpected end of slice
4141
MissingNodes,
4242

43-
/// Unexpected [`FlatCondition::EndCollection`] i.e. end without previous start
43+
/// Unexpected `FlatCondition::EndCollection` i.e. end without previous start
4444
CollectionEnd,
4545

4646
/// Invalid value index

src/internal/relation_path.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ impl fmt::Debug for PathId {
173173
/// from [`ParentField::Model`](PathField::ParentField)
174174
/// to [`ChildField::Model`](PathField::ChildField).
175175
///
176-
/// Implementors are fields with type [`ForeignModel`] or [`BackRef`].
176+
/// Implementors are fields with type [`ForeignModel`](crate::fields::types::ForeignModel) or [`BackRef`].
177177
///
178178
/// `ChildField` and `ParentField` are not necessarily the same as `Self`
179179
/// but they both have to represent a single column, one of them has to

0 commit comments

Comments
 (0)