Skip to content

Commit

Permalink
add minimal doc entry for the traits
Browse files Browse the repository at this point in the history
  • Loading branch information
imrn99 committed May 13, 2024
1 parent 8e93813 commit ff9b2fc
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions integraal/src/traits.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
//! module doc
/// Scalar domain value trait.
///
/// This trait is automatically implemented for all types implementing its requirements.
pub trait DomainScalar:
Clone + Copy + std::ops::Sub<Output = Self> + num::Float + num::Signed + num::FromPrimitive
{
Expand All @@ -11,6 +14,9 @@ impl<
{
}

/// Scalar image value trait.
///
/// This trait is automatically implemented for all types implementing its requirements.
pub trait ImageScalar<X: DomainScalar, W: IntegratedScalar>:
Clone
+ Copy
Expand All @@ -36,6 +42,9 @@ impl<
{
}

/// Scalar post-integration value trait.
///
/// This trait is automatically implemented for all types implementing its requirements.
pub trait IntegratedScalar: Clone + Copy + std::iter::Sum {}

impl<W: Clone + Copy + std::iter::Sum> IntegratedScalar for W {}

0 comments on commit ff9b2fc

Please sign in to comment.