use crate::box_iter::BoxIter;
use crate::path::Opt;
use core::fmt::Display;
use core::ops::{Add, Div, Mul, Neg, Rem, Sub};
#[cfg(doc)]
use core::str::FromStr;
pub type ValR<T, V = T> = Result<T, crate::Error<V>>;
pub type ValRs<'a, T, V = T> = BoxIter<'a, ValR<T, V>>;
pub type ValX<'a, T, V = T> = Result<T, crate::Exn<'a, V>>;
pub type ValXs<'a, T, V = T> = BoxIter<'a, ValX<'a, T, V>>;
pub fn unwrap_valr<T, V>(v: ValX<T, V>) -> ValR<T, V> {
v.map_err(|e| e.get_err().ok().unwrap())
}
pub type Range<V> = core::ops::Range<Option<V>>;
pub trait ValT:
Clone
+ Display
+ From<bool>
+ From<isize>
+ From<alloc::string::String>
+ From<Range<Self>>
+ FromIterator<Self>
+ PartialEq
+ PartialOrd
+ Add<Output = ValR<Self>>
+ Sub<Output = ValR<Self>>
+ Mul<Output = ValR<Self>>
+ Div<Output = ValR<Self>>
+ Rem<Output = ValR<Self>>
+ Neg<Output = ValR<Self>>
{
fn from_num(n: &str) -> ValR<Self>;
fn from_map<I: IntoIterator<Item = (Self, Self)>>(iter: I) -> ValR<Self>;
fn key_values(self) -> BoxIter<'static, ValR<(Self, Self), Self>>;
fn values(self) -> alloc::boxed::Box<dyn Iterator<Item = ValR<Self>>>;
fn index(self, index: &Self) -> ValR<Self>;
fn range(self, range: Range<&Self>) -> ValR<Self>;
fn map_values<'a, I: Iterator<Item = ValX<'a, Self>>>(
self,
opt: Opt,
f: impl Fn(Self) -> I,
) -> ValX<'a, Self>;
fn map_index<'a, I: Iterator<Item = ValX<'a, Self>>>(
self,
index: &Self,
opt: Opt,
f: impl Fn(Self) -> I,
) -> ValX<'a, Self>;
fn map_range<'a, I: Iterator<Item = ValX<'a, Self>>>(
self,
range: Range<&Self>,
opt: Opt,
f: impl Fn(Self) -> I,
) -> ValX<'a, Self>;
fn as_bool(&self) -> bool;
fn into_string(self) -> Self;
}