avina-wire 2.2.0

Rust types for API communication of the LRZ-specific features of the Openstack-based LRZ Compute Cloud.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use std::{borrow::Borrow, fmt::Display};

// TODO: use Option<&T> instead
pub fn display_option<T: Display>(option: &Option<T>) -> String {
    match option {
        Some(value) => value.to_string(),
        None => "".to_string(),
    }
}

#[allow(dead_code)]
pub fn is_true(b: impl Borrow<bool>) -> bool {
    *b.borrow()
}

pub fn is_false(b: impl Borrow<bool>) -> bool {
    !b.borrow()
}