pub struct DeprecatedField {
pub old_name: String,
pub new_name: String,
pub deprecated_in: SchemaVersion,
pub removed_in: Option<SchemaVersion>,
}Expand description
Deprecated field mapping for backward compatibility
Fields§
§old_name: StringOld field name
new_name: StringNew field name (replacement)
deprecated_in: SchemaVersionVersion when the field was deprecated
removed_in: Option<SchemaVersion>Version when the field will be removed (optional)
Implementations§
Source§impl DeprecatedField
impl DeprecatedField
Sourcepub fn new(
old_name: String,
new_name: String,
deprecated_in: SchemaVersion,
) -> Self
pub fn new( old_name: String, new_name: String, deprecated_in: SchemaVersion, ) -> Self
Create a new deprecated field mapping
Sourcepub fn with_removal(self, removed_in: SchemaVersion) -> Self
pub fn with_removal(self, removed_in: SchemaVersion) -> Self
Set the version when the field will be removed
Sourcepub fn is_supported_in(&self, version: &SchemaVersion) -> bool
pub fn is_supported_in(&self, version: &SchemaVersion) -> bool
Check if the field is still supported in a version
Trait Implementations§
Source§impl Clone for DeprecatedField
impl Clone for DeprecatedField
Source§fn clone(&self) -> DeprecatedField
fn clone(&self) -> DeprecatedField
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for DeprecatedField
impl RefUnwindSafe for DeprecatedField
impl Send for DeprecatedField
impl Sync for DeprecatedField
impl Unpin for DeprecatedField
impl UnwindSafe for DeprecatedField
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