PhantomContravariant in std::marker - Rust (original) (raw)

Struct PhantomContravariant

Source

pub struct PhantomContravariant<T>(/* private fields */)
where
    T: ?Sized;

🔬This is a nightly-only experimental API. (phantom_variance_markers #135806)

Expand description

Zero-sized type used to mark a type parameter as contravariant.

Types passed as arguments to a function are contravariant. If the type is also part of the return value from a function then it is invariant. See the reference for more information.

§Layout

For all T, the following are guaranteed:

Source§

Source

🔬This is a nightly-only experimental API. (phantom_variance_markers #135806)

Constructs a new instance of the variance marker.

Source§

Source§

Source§

Source§

Source§

Source§

Source§

Tests for self and other values to be equal, and is used by ==.

1.0.0 · Source§

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Source§

Source§

This method returns an ordering between self and other values if one exists. Read more

1.0.0 · Source§

Tests less than (for self and other) and is used by the < operator. Read more

1.0.0 · Source§

Tests less than or equal to (for self and other) and is used by the<= operator. Read more

1.0.0 · Source§

Tests greater than (for self and other) and is used by the >operator. Read more

1.0.0 · Source§

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Source§

Source§

Source§