Skip to content

Commit b1943c2

Browse files
committed
Add pub and doc to Lrs
1 parent 97038ab commit b1943c2

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

src/lrs.rs

+16-5
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,25 @@ pub struct LrmHandle(usize);
2323
#[derive(Copy, Clone, Debug, Eq, Hash, PartialEq)]
2424
pub struct TraversalHandle(usize);
2525

26-
struct Lrm {
27-
scale: LrmScale,
28-
reference_traversal: TraversalHandle,
29-
traversals: Vec<TraversalHandle>,
26+
/// Represents an Linear Reference Method (LRM)
27+
/// It is the combination of one (or more) [`Traversals`] for one [`LrmScale`]
28+
pub struct Lrm {
29+
/// The scale of the LRM
30+
pub scale: LrmScale,
31+
/// Traversal that is the reference of this LRM
32+
pub reference_traversal: TraversalHandle,
33+
/// All the traversals where this LRM applies
34+
pub traversals: Vec<TraversalHandle>,
3035
}
3136

37+
/// A traversal is path in the network that ends [`Curve`]
38+
/// That traversals can be used for many different [`Lrm`]
3239
struct Traversal<CurveImpl: Curve> {
40+
/// Identifies the traversal
3341
id: String,
42+
/// The geometrical curve of the traversal
3443
curve: CurveImpl,
44+
/// All the [`Lrm`] that use this traversal
3545
lrms: Vec<LrmHandle>,
3646
}
3747

@@ -251,7 +261,8 @@ pub enum LrsError {
251261
InvalidArchive,
252262
}
253263

254-
trait LrsBase {
264+
/// The basic functions to manipulate the LRS
265+
pub trait LrsBase {
255266
/// Returns the [`LrmHandle`] (if it exists) of the [`Lrm`] identified by its `lrm_id`.
256267
fn get_lrm(&self, lrm_id: &str) -> Option<LrmHandle>;
257268
/// Returns the [`TraversalHandle`] (if it exists) of the [`Traversal`] identified by its `traversal_id`.

0 commit comments

Comments
 (0)