fn sum(left: Self, right: Self) -> Self {
        if let (Some(left), Some(right)) = (left, right) {
            S::try_sum(left, right).ok()
        } else {
            None
        }
    }
/// Sums the values if both are available.
///
/// ```
/// # use proofmarshal_core::collections::merklesum::MerkleSum;
/// assert_eq!(<Option<u8> as MerkleSum<u8>>::sum(Some(1), Some(2)),
///            Some(3));
/// ```
///
/// ```
/// # use proofmarshal_core::collections::merklesum::MerkleSum;
/// assert_eq!(<Option<u8> as MerkleSum<u8>>::sum(Some(255), Some(1)),
///            None);
/// assert_eq!(<Option<u8> as MerkleSum<u8>>::sum(Some(1), None),
///            None);
/// assert_eq!(<Option<u8> as MerkleSum<u8>>::sum(None, Some(2)),
///            None);
/// assert_eq!(<Option<u8> as MerkleSum<u8>>::sum(None, None),
///            None);
/// ```
Sums the values if both are available.
Sums the values if both are available .
fn sum(left: Self, right: Self) -> Self {
        if let (Some(left), Some(right)) = (left, right) {
            S::try_sum(left, right).ok()
        } else {
            None
        }
    }
fn sum ( left : Self , right : Self ) -> Self { if let ( Some ( left ) , Some ( right ) ) = ( left , right ) { S :: try_sum ( left , right ) . ok ( ) } else { None } }
Sums the values if both are available.
Sums the values if both are available .
left
Self
right
Self
use proofmarshal_core::collections::merklesum::merklesum;
None
use proofmarshal_core::collections::merklesum::merklesum;
assert_eq!( as MerkleSum>::sum(Some(255), Some(1)),
None);
assert_eq!( as MerkleSum>::sum(Some(1), None),
None);
assert_eq!( as MerkleSum>::sum(None, Some(2)),
None);
assert_eq!( as MerkleSum>::sum(None, None),
None);
```
assert_eq! ( as MerkleSum > :: sum ( Some ( 255 ) Some ( 1 )) None ) ; assert_eq! ( as MerkleSum > :: sum ( Some ( 1 ) None ) None ) ; assert_eq! ( as MerkleSum > :: sum ( None Some ( 2 )) None ) ; assert_eq! ( as MerkleSum > :: sum ( None None ) None ) ; ` ` `