boreholeio 0.1.0

A library for interacting with borehole.io, a subsurface data management, delivery and visualisation platform
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
pub type Error = String;

pub(crate) fn convert<A, B>(n: A) -> B
where
    A: TryInto<B>,
    <A as TryInto<B>>::Error: std::fmt::Debug,
{
    TryInto::<B>::try_into(n).unwrap()
}

pub(crate) fn convert_vec<A, B>(v: &[A]) -> Vec<B>
where
    A: Copy + TryInto<B>,
    <A as TryInto<B>>::Error: std::fmt::Debug,
{
    v.iter().map(|a| convert::<A, B>(*a)).collect()
}