pub struct DeprecationParams {
pub since: String,
pub message: Option<String>,
pub name: Option<String>,
pub alternative: Option<String>,
pub alternative_import: Option<String>,
pub pending: bool,
pub obj_type: Option<String>,
pub addendum: Option<String>,
pub removal: Option<String>,
pub package: Option<String>,
}Expand description
Parameters for configuring deprecation warnings.
Fields§
§since: StringThe release at which this API became deprecated.
message: Option<String>Override the default deprecation message.
name: Option<String>The name of the deprecated object.
alternative: Option<String>An alternative API that the user may use in place of the deprecated API.
alternative_import: Option<String>An alternative import path that the user may use instead.
pending: boolIf true, uses a pending deprecation warning instead.
obj_type: Option<String>The object type being deprecated (e.g., “function”, “class”, “method”).
addendum: Option<String>Additional text appended directly to the final message.
removal: Option<String>The expected removal version.
package: Option<String>The package of the deprecated object.
Implementations§
Source§impl DeprecationParams
impl DeprecationParams
Sourcepub fn new(since: impl Into<String>) -> Self
pub fn new(since: impl Into<String>) -> Self
Create new deprecation parameters with the version when deprecation started.
Sourcepub fn with_message(self, message: impl Into<String>) -> Self
pub fn with_message(self, message: impl Into<String>) -> Self
Set a custom deprecation message.
Sourcepub fn with_alternative(self, alternative: impl Into<String>) -> Self
pub fn with_alternative(self, alternative: impl Into<String>) -> Self
Set the alternative to use instead of the deprecated item.
Sourcepub fn with_alternative_import(
self,
alternative_import: impl Into<String>,
) -> Self
pub fn with_alternative_import( self, alternative_import: impl Into<String>, ) -> Self
Set the alternative import path.
Sourcepub fn with_pending(self, pending: bool) -> Self
pub fn with_pending(self, pending: bool) -> Self
Mark this as a pending deprecation.
Sourcepub fn with_obj_type(self, obj_type: impl Into<String>) -> Self
pub fn with_obj_type(self, obj_type: impl Into<String>) -> Self
Set the object type.
Sourcepub fn with_addendum(self, addendum: impl Into<String>) -> Self
pub fn with_addendum(self, addendum: impl Into<String>) -> Self
Set the addendum text.
Sourcepub fn with_removal(self, removal: impl Into<String>) -> Self
pub fn with_removal(self, removal: impl Into<String>) -> Self
Set the expected removal version.
Sourcepub fn with_package(self, package: impl Into<String>) -> Self
pub fn with_package(self, package: impl Into<String>) -> Self
Set the package name.
Trait Implementations§
Source§impl Clone for DeprecationParams
impl Clone for DeprecationParams
Source§fn clone(&self) -> DeprecationParams
fn clone(&self) -> DeprecationParams
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more