Skip to main content

Cross

Enum Cross 

Source
pub enum Cross {
    Into,
    Map(Path),
}
Expand description

HOW a field’s value reaches its seat.

Variants§

§

Into

into — the seat takes impl Into<…>, so the argument’s type is PINNED to the field’s own.

Inference is what needs the word. The bridge takes its target from the position it lands in, and a position spelled impl Into<X> is an anonymous type parameter rather than a type — so bridge(value) there asks the compiler to pick some T: Into<X> out of the whole program and it correctly refuses (E0283). Pinning the target to the type the manifest restated resolves it, and the remaining T: Into<X> obligation is the upstream’s own signature doing its job.

§

Map(Path)

map = "…" — the value crosses through the named function instead of through the bridge.

The last 1% the bridge cannot reach: two types with no conversion between them, a lossy narrowing an author is willing to declare, a unit change. It OVERRIDES a blanket that would otherwise have claimed the field, which is the precedence a per-field word always has over a per-type one.

Trait Implementations§

Source§

impl Clone for Cross

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Cross

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Cross

Source§

impl PartialEq for Cross

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Cross

Auto Trait Implementations§

§

impl !Send for Cross

§

impl !Sync for Cross

§

impl Freeze for Cross

§

impl RefUnwindSafe for Cross

§

impl Unpin for Cross

§

impl UnsafeUnpin for Cross

§

impl UnwindSafe for Cross

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.