pub trait OptionU32Ext {
    // Required method
    fn unwrap_ori(self, _: i64) -> i64;
}

Required Methods§

source

fn unwrap_ori(self, _: i64) -> i64

Return the inner value of self is Some, or alternative

Arguments
  • self - The value to check.
  • alternative - The alternative value to return.
Returns

One of the two values.

Examples
use libhealth::utils::prelude::*;

let val: Option<u32> = Some(5);
let none: Option<u32> = None;
assert_eq!(val.unwrap_ori(-1), 5);
assert_eq!(none.unwrap_ori(-1), -1);

Implementations on Foreign Types§

source§

impl OptionU32Ext for Option<u32>

source§

fn unwrap_ori(self, alternative: i64) -> i64

Implementors§