Trait Data

pub trait Data: 'static + Clone {
    // Required method
    fn same(&self, other: &Self) -> bool;
}
Expand description

A trait for fast comparisons of data. Implemented by any type which can be bound to, i.e. can be cached and compared against previous versions.

Required Methods§

fn same(&self, other: &Self) -> bool

A method which determines whether two pieces of data are the same.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

§

impl Data for &'static str

§

fn same(&self, other: &&'static str) -> bool

§

impl Data for IpAddr

§

fn same(&self, other: &IpAddr) -> bool

§

impl Data for SocketAddr

§

fn same(&self, other: &SocketAddr) -> bool

§

impl Data for ErrorKind

§

fn same(&self, other: &ErrorKind) -> bool

§

impl Data for bool

§

fn same(&self, other: &bool) -> bool

§

impl Data for char

§

fn same(&self, other: &char) -> bool

§

impl Data for f32

§

fn same(&self, other: &f32) -> bool

§

impl Data for f64

§

fn same(&self, other: &f64) -> bool

§

impl Data for i8

§

fn same(&self, other: &i8) -> bool

§

impl Data for i16

§

fn same(&self, other: &i16) -> bool

§

impl Data for i32

§

fn same(&self, other: &i32) -> bool

§

impl Data for i64

§

fn same(&self, other: &i64) -> bool

§

impl Data for i128

§

fn same(&self, other: &i128) -> bool

§

impl Data for isize

§

fn same(&self, other: &isize) -> bool

§

impl Data for u8

§

fn same(&self, other: &u8) -> bool

§

impl Data for u16

§

fn same(&self, other: &u16) -> bool

§

impl Data for u32

§

fn same(&self, other: &u32) -> bool

§

impl Data for u64

§

fn same(&self, other: &u64) -> bool

§

impl Data for u128

§

fn same(&self, other: &u128) -> bool

§

impl Data for ()

§

fn same(&self, _other: &()) -> bool

§

impl Data for usize

§

fn same(&self, other: &usize) -> bool

§

impl Data for String

§

fn same(&self, other: &String) -> bool

§

impl Data for Ipv4Addr

§

fn same(&self, other: &Ipv4Addr) -> bool

§

impl Data for Ipv6Addr

§

fn same(&self, other: &Ipv6Addr) -> bool

§

impl Data for SocketAddrV4

§

fn same(&self, other: &SocketAddrV4) -> bool

§

impl Data for SocketAddrV6

§

fn same(&self, other: &SocketAddrV6) -> bool

§

impl Data for NonZero<i8>

§

fn same(&self, other: &NonZero<i8>) -> bool

§

impl Data for NonZero<i16>

§

fn same(&self, other: &NonZero<i16>) -> bool

§

impl Data for NonZero<i32>

§

fn same(&self, other: &NonZero<i32>) -> bool

§

impl Data for NonZero<i64>

§

fn same(&self, other: &NonZero<i64>) -> bool

§

impl Data for NonZero<i128>

§

fn same(&self, other: &NonZero<i128>) -> bool

§

impl Data for NonZero<isize>

§

fn same(&self, other: &NonZero<isize>) -> bool

§

impl Data for NonZero<u8>

§

fn same(&self, other: &NonZero<u8>) -> bool

§

impl Data for NonZero<u16>

§

fn same(&self, other: &NonZero<u16>) -> bool

§

impl Data for NonZero<u32>

§

fn same(&self, other: &NonZero<u32>) -> bool

§

impl Data for NonZero<u64>

§

fn same(&self, other: &NonZero<u64>) -> bool

§

impl Data for NonZero<u128>

§

fn same(&self, other: &NonZero<u128>) -> bool

§

impl Data for NonZero<usize>

§

fn same(&self, other: &NonZero<usize>) -> bool

§

impl Data for RangeFull

§

fn same(&self, other: &RangeFull) -> bool

§

impl Data for PathBuf

§

fn same(&self, other: &PathBuf) -> bool

§

impl Data for SystemTime

§

fn same(&self, other: &SystemTime) -> bool

§

impl Data for NaiveDate

§

fn same(&self, other: &NaiveDate) -> bool

§

impl Data for NaiveTime

§

fn same(&self, other: &NaiveTime) -> bool

§

impl<T0> Data for (T0,)
where T0: Data,

§

fn same(&self, other: &(T0,)) -> bool

§

impl<T0, T1> Data for (T0, T1)
where T0: Data, T1: Data,

§

fn same(&self, other: &(T0, T1)) -> bool

§

impl<T0, T1, T2> Data for (T0, T1, T2)
where T0: Data, T1: Data, T2: Data,

§

fn same(&self, other: &(T0, T1, T2)) -> bool

§

impl<T0, T1, T2, T3> Data for (T0, T1, T2, T3)
where T0: Data, T1: Data, T2: Data, T3: Data,

§

fn same(&self, other: &(T0, T1, T2, T3)) -> bool

§

impl<T0, T1, T2, T3, T4> Data for (T0, T1, T2, T3, T4)
where T0: Data, T1: Data, T2: Data, T3: Data, T4: Data,

§

fn same(&self, other: &(T0, T1, T2, T3, T4)) -> bool

§

impl<T0, T1, T2, T3, T4, T5> Data for (T0, T1, T2, T3, T4, T5)
where T0: Data, T1: Data, T2: Data, T3: Data, T4: Data, T5: Data,

§

fn same(&self, other: &(T0, T1, T2, T3, T4, T5)) -> bool

§

impl<T> Data for &'static [T]
where T: Data,

§

fn same(&self, other: &&'static [T]) -> bool

§

impl<T> Data for Bound<T>
where T: Data,

§

fn same(&self, other: &Bound<T>) -> bool

§

impl<T> Data for Option<T>
where T: Data,

§

fn same(&self, other: &Option<T>) -> bool

§

impl<T> Data for Rc<T>
where T: 'static + ?Sized,

§

fn same(&self, other: &Rc<T>) -> bool

§

impl<T> Data for Weak<T>
where T: 'static + ?Sized,

§

fn same(&self, other: &Weak<T>) -> bool

§

impl<T> Data for Arc<T>
where T: 'static + ?Sized,

§

fn same(&self, other: &Arc<T>) -> bool

§

impl<T> Data for Weak<T>
where T: 'static + ?Sized,

§

fn same(&self, other: &Weak<T>) -> bool

§

impl<T> Data for Vec<T>
where T: Data,

§

fn same(&self, other: &Vec<T>) -> bool

§

impl<T> Data for PhantomData<T>
where T: 'static + ?Sized,

§

fn same(&self, _other: &PhantomData<T>) -> bool

§

impl<T> Data for ManuallyDrop<T>
where T: 'static + Data,

§

fn same(&self, other: &ManuallyDrop<T>) -> bool

§

impl<T> Data for Discriminant<T>
where T: 'static,

§

fn same(&self, other: &Discriminant<T>) -> bool

§

impl<T> Data for Wrapping<T>
where T: Data,

§

fn same(&self, other: &Wrapping<T>) -> bool

§

impl<T> Data for Range<T>
where T: Data,

§

fn same(&self, other: &Range<T>) -> bool

§

impl<T> Data for RangeFrom<T>
where T: Data,

§

fn same(&self, other: &RangeFrom<T>) -> bool

§

impl<T> Data for RangeInclusive<T>
where T: Data,

§

fn same(&self, other: &RangeInclusive<T>) -> bool

§

impl<T> Data for RangeTo<T>
where T: Data,

§

fn same(&self, other: &RangeTo<T>) -> bool

§

impl<T> Data for RangeToInclusive<T>
where T: Data,

§

fn same(&self, other: &RangeToInclusive<T>) -> bool

§

impl<T> Data for HashSet<T>
where T: Hash + Eq + Data,

§

fn same(&self, other: &HashSet<T>) -> bool

§

impl<T, U> Data for Result<T, U>
where T: Data, U: Data,

§

fn same(&self, other: &Result<T, U>) -> bool

§

impl<T, V> Data for HashMap<T, V>
where T: Hash + Eq + Data, V: Data,

§

fn same(&self, other: &HashMap<T, V>) -> bool

Implementors§