use crate::std::iter::Iterator;
pub trait IsEmptyProperty {
fn is_empty_property(&self) -> bool;
}
impl<T> IsEmptyProperty for &T
where
T: IsEmptyProperty + ?Sized,
{
fn is_empty_property(&self) -> bool {
<T as IsEmptyProperty>::is_empty_property(self)
}
}
impl<T> IsEmptyProperty for &mut T
where
T: IsEmptyProperty + ?Sized,
{
fn is_empty_property(&self) -> bool {
<T as IsEmptyProperty>::is_empty_property(self)
}
}
pub trait LengthProperty {
fn length_property(&self) -> usize;
}
impl<T> LengthProperty for &T
where
T: LengthProperty + ?Sized,
{
fn length_property(&self) -> usize {
<T as LengthProperty>::length_property(self)
}
}
impl<T> LengthProperty for &mut T
where
T: LengthProperty + ?Sized,
{
fn length_property(&self) -> usize {
<T as LengthProperty>::length_property(self)
}
}
pub trait DefinedOrderProperty {}
impl<C> DefinedOrderProperty for &C where C: DefinedOrderProperty + ?Sized {}
impl<C> DefinedOrderProperty for &mut C where C: DefinedOrderProperty + ?Sized {}
pub trait CharCountProperty {
fn char_count_property(&self) -> usize;
}
impl<T> CharCountProperty for &T
where
T: CharCountProperty + ?Sized,
{
fn char_count_property(&self) -> usize {
<T as CharCountProperty>::char_count_property(self)
}
}
impl<T> CharCountProperty for &mut T
where
T: CharCountProperty + ?Sized,
{
fn char_count_property(&self) -> usize {
<T as CharCountProperty>::char_count_property(self)
}
}
pub trait AdditiveIdentityProperty {
fn additive_identity() -> Self;
}
pub trait MultiplicativeIdentityProperty {
fn multiplicative_identity() -> Self;
}
pub trait SignumProperty {
fn is_negative_property(&self) -> bool;
fn is_positive_property(&self) -> bool;
}
impl<T> SignumProperty for &T
where
T: SignumProperty + ?Sized,
{
fn is_negative_property(&self) -> bool {
<T as SignumProperty>::is_negative_property(self)
}
fn is_positive_property(&self) -> bool {
<T as SignumProperty>::is_positive_property(self)
}
}
impl<T> SignumProperty for &mut T
where
T: SignumProperty + ?Sized,
{
fn is_negative_property(&self) -> bool {
<T as SignumProperty>::is_negative_property(self)
}
fn is_positive_property(&self) -> bool {
<T as SignumProperty>::is_positive_property(self)
}
}
pub trait InfinityProperty {
fn is_infinite_property(&self) -> bool;
fn is_finite_property(&self) -> bool;
}
impl<T> InfinityProperty for &T
where
T: InfinityProperty + ?Sized,
{
fn is_infinite_property(&self) -> bool {
<T as InfinityProperty>::is_infinite_property(self)
}
fn is_finite_property(&self) -> bool {
<T as InfinityProperty>::is_finite_property(self)
}
}
impl<T> InfinityProperty for &mut T
where
T: InfinityProperty + ?Sized,
{
fn is_infinite_property(&self) -> bool {
<T as InfinityProperty>::is_infinite_property(self)
}
fn is_finite_property(&self) -> bool {
<T as InfinityProperty>::is_finite_property(self)
}
}
pub trait IsNanProperty {
fn is_nan_property(&self) -> bool;
}
impl<T> IsNanProperty for &T
where
T: IsNanProperty + ?Sized,
{
fn is_nan_property(&self) -> bool {
<T as IsNanProperty>::is_nan_property(self)
}
}
impl<T> IsNanProperty for &mut T
where
T: IsNanProperty + ?Sized,
{
fn is_nan_property(&self) -> bool {
<T as IsNanProperty>::is_nan_property(self)
}
}
pub trait DecimalProperties {
fn precision_property(&self) -> u64;
fn scale_property(&self) -> i64;
fn is_integer_property(&self) -> bool;
}
impl<T> DecimalProperties for &T
where
T: DecimalProperties + ?Sized,
{
fn precision_property(&self) -> u64 {
<T as DecimalProperties>::precision_property(self)
}
fn scale_property(&self) -> i64 {
<T as DecimalProperties>::scale_property(self)
}
fn is_integer_property(&self) -> bool {
<T as DecimalProperties>::is_integer_property(self)
}
}
impl<T> DecimalProperties for &mut T
where
T: DecimalProperties + ?Sized,
{
fn precision_property(&self) -> u64 {
<T as DecimalProperties>::precision_property(self)
}
fn scale_property(&self) -> i64 {
<T as DecimalProperties>::scale_property(self)
}
fn is_integer_property(&self) -> bool {
<T as DecimalProperties>::is_integer_property(self)
}
}
pub trait MapProperties {
type Key;
type Value;
fn keys_property(&self) -> impl Iterator<Item = &Self::Key>;
fn values_property(&self) -> impl Iterator<Item = &Self::Value>;
fn entries_property(&self) -> impl Iterator<Item = (&Self::Key, &Self::Value)>;
}