Skip to main content

Upgrade

Trait Upgrade 

Source
pub trait Upgrade<Next>
where Self: Sized,
{ type Lossiness; // Required method fn upgrade(self) -> Translation<Self, Next, Self::Lossiness>; }
Expand description

Implement this to describe how Self migrates forward to Next.

The associated Lossiness type must be either Lossy or Lossless, encoding at the type level whether the upgrade is destructive.

Required Associated Types§

Source

type Lossiness

Lossy if the upgrade drops fields; Lossless otherwise.

Required Methods§

Source

fn upgrade(self) -> Translation<Self, Next, Self::Lossiness>

Produce a Translation without executing it.

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.

Implementors§