dvcompute_experiment_cons 2.0.1

Discrete event simulation library (support of experiments for conservative distributed simulation)
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Copyright (c) 2020-2022  David Sorokin <davsor@mail.ru>, based in Yoshkar-Ola, Russia
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

use std::io;
use std::result;

use dvcompute::simulation;

/// Convert the result value.
pub fn convert_result<T>(x: io::Result<T>) -> simulation::Result<T> {
    match x {
        result::Result::Ok(a) => result::Result::Ok(a),
        result::Result::Err(e) => result::Result::Err(simulation::error::Error::io(e))
    }
}