PhantomCovariant in core::marker - Rust (original) (raw)

Struct PhantomCovariant

Source

pub struct PhantomCovariant<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 covariant.

Types used as part of the return value from a function are covariant. If the type is _also_passed as a parameter 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§