use core::fmt;
use core::ops::{BitAnd, BitAndAssign, BitOr, BitOrAssign, BitXor, BitXorAssign, Sub, SubAssign};
use super::Treemap;
impl fmt::Debug for Treemap {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
if self.cardinality() < 32 {
write!(f, "Treemap<{:?}>", self.to_vec())
} else {
write!(
f,
"Treemap<{}, [{:?}..{:?}]>",
self.cardinality(),
self.minimum().unwrap(),
self.maximum().unwrap()
)
}
}
}
impl Default for Treemap {
fn default() -> Self {
Self::new()
}
}
impl BitAnd for Treemap {
type Output = Treemap;
#[inline]
fn bitand(self, other: Treemap) -> Treemap {
self.and(&other)
}
}
impl<'a> BitAnd<&'a Treemap> for Treemap {
type Output = Treemap;
#[inline]
fn bitand(self, other: &'a Treemap) -> Treemap {
self.and(other)
}
}
impl<'a, 'b> BitAnd<&'a Treemap> for &'b Treemap {
type Output = Treemap;
#[inline]
fn bitand(self, other: &'a Treemap) -> Treemap {
self.and(other)
}
}
impl BitAndAssign for Treemap {
#[inline]
fn bitand_assign(&mut self, other: Treemap) {
self.and_inplace(&other);
}
}
impl BitOr for Treemap {
type Output = Treemap;
#[inline]
fn bitor(self, other: Treemap) -> Treemap {
self.or(&other)
}
}
impl<'a> BitOr<&'a Treemap> for Treemap {
type Output = Treemap;
#[inline]
fn bitor(self, other: &'a Treemap) -> Treemap {
self.or(other)
}
}
impl<'a, 'b> BitOr<&'a Treemap> for &'b Treemap {
type Output = Treemap;
#[inline]
fn bitor(self, other: &'a Treemap) -> Treemap {
self.or(other)
}
}
impl BitOrAssign for Treemap {
#[inline]
fn bitor_assign(&mut self, other: Treemap) {
self.or_inplace(&other);
}
}
impl BitXor for Treemap {
type Output = Treemap;
#[inline]
fn bitxor(self, other: Treemap) -> Treemap {
self.xor(&other)
}
}
impl<'a> BitXor<&'a Treemap> for Treemap {
type Output = Treemap;
#[inline]
fn bitxor(self, other: &'a Treemap) -> Treemap {
self.xor(other)
}
}
impl<'a, 'b> BitXor<&'a Treemap> for &'b Treemap {
type Output = Treemap;
#[inline]
fn bitxor(self, other: &'a Treemap) -> Treemap {
self.xor(other)
}
}
impl BitXorAssign for Treemap {
#[inline]
fn bitxor_assign(&mut self, other: Treemap) {
self.xor_inplace(&other);
}
}
impl Sub for Treemap {
type Output = Treemap;
#[inline]
fn sub(self, other: Treemap) -> Treemap {
self.andnot(&other)
}
}
impl<'a> Sub<&'a Treemap> for Treemap {
type Output = Treemap;
#[inline]
fn sub(self, other: &'a Treemap) -> Treemap {
self.andnot(other)
}
}
impl<'a, 'b> Sub<&'a Treemap> for &'b Treemap {
type Output = Treemap;
#[inline]
fn sub(self, other: &'a Treemap) -> Treemap {
self.andnot(other)
}
}
impl SubAssign for Treemap {
#[inline]
fn sub_assign(&mut self, other: Treemap) {
self.andnot_inplace(&other);
}
}