pub struct Deprecation {
pub since: Version,
pub replaced_by: Option<fn() -> &'static str>,
pub migration: &'static str,
}Expand description
Why a variable is going away and what to do instead.
Bundled into one struct so an entry cannot be half-deprecated.
Fields§
§since: VersionThe version in which the variable became deprecated.
replaced_by: Option<fn() -> &'static str>A compile-checked reference to the successor, when there is a clean
1:1 replacement. Store a function that reads the successor’s key
(Some(|| Model::NEW_INPUT.key)): rename or delete the successor and
this stops compiling, so the pointer can never dangle.
migration: &'static strHuman guidance when there is no clean successor — a config key to use, a “simply remove it”, a split into two variables. Advisory prose: a machine must not try to apply it automatically.
Trait Implementations§
Source§impl Clone for Deprecation
impl Clone for Deprecation
Source§fn clone(&self) -> Deprecation
fn clone(&self) -> Deprecation
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for Deprecation
Auto Trait Implementations§
impl Forget for Deprecation
impl Freeze for Deprecation
impl Move for Deprecation
impl RefUnwindSafe for Deprecation
impl Send for Deprecation
impl Sync for Deprecation
impl Unpin for Deprecation
impl UnsafeUnpin for Deprecation
impl UnwindSafe for Deprecation
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more