warn_deprecated

Function warn_deprecated 

Source
pub fn warn_deprecated(params: DeprecationParams, caller_module: &str)
Expand description

Display a standardized deprecation warning.

§Arguments

  • params - Parameters for the deprecation warning.
  • caller_module - The module path of the caller (typically from module_path!() macro).

§Example

use agent_chain_core::api::{warn_deprecated, DeprecationParams};

// Simple deprecation warning
warn_deprecated(
    DeprecationParams::new("0.1.0")
        .with_name("old_function")
        .with_removal("0.2.0"),
    module_path!()
);

// With alternative
warn_deprecated(
    DeprecationParams::new("0.1.0")
        .with_name("OldClass")
        .with_obj_type("class")
        .with_alternative("NewClass")
        .with_removal("0.2.0"),
    module_path!()
);