Trait sgx_tstd::cmp::Eq1.0.0[][src]

pub trait Eq: PartialEq<Self> { }

Trait for equality comparisons which are equivalence relations.

This means, that in addition to a == b and a != b being strict inverses, the equality must be (for all a, b and c):

This property cannot be checked by the compiler, and therefore Eq implies PartialEq, and has no extra methods.

Derivable

This trait can be used with #[derive]. When derived, because Eq has no extra methods, it is only informing the compiler that this is an equivalence relation rather than a partial equivalence relation. Note that the derive strategy requires all fields are Eq, which isn't always desired.

How can I implement Eq?

If you cannot use the derive strategy, specify that your type implements Eq, which has no methods:

enum BookFormat { Paperback, Hardback, Ebook }
struct Book {
    isbn: i32,
    format: BookFormat,
}
impl PartialEq for Book {
    fn eq(&self, other: &Book) -> bool {
        self.isbn == other.isbn
    }
}
impl Eq for Book {}

Implementations on Foreign Types

impl Eq for CannotReallocInPlace
[src]

impl Eq for Layout
[src]

impl Eq for Duration
[src]

impl<T> Eq for Poll<T> where
    T: Eq
[src]

impl Eq for LayoutErr
[src]

impl<'a> Eq for Utf8LossyChunk<'a>
[src]

impl Eq for AllocErr
[src]

impl Eq for sgx_rsa_result_t
[src]

impl Eq for sgx_quote_sign_type_t
[src]

impl Eq for sgx_generic_ecresult_t
[src]

impl Eq for sgx_status_t
[src]

impl Eq for sgx_exception_type_t
[src]

impl Eq for sgx_exception_vector_t
[src]

impl Eq for sgx_uswitchless_worker_type_t
[src]

impl Eq for sgx_device_status_t
[src]

impl Eq for sgx_rsa_key_type_t
[src]

impl Eq for sgx_uswitchless_worker_event_t
[src]

impl Eq for sgx_dh_session_role_t
[src]

impl Eq for sgx_ra_key_type_t
[src]

impl Eq for SeekFrom
[src]

Implementors