pub struct LifecycleSpec {
pub stage: LifecycleStage,
pub when: Option<String>,
pub what: Option<String>,
pub with: Option<String>,
pub details: Option<String>,
pub id: Option<String>,
}Expand description
Full lifecycle specification for a function or method.
Fields§
§stage: LifecycleStageThe lifecycle stage.
when: Option<String>Version when the lifecycle change occurred (e.g., “0.4.0”).
what: Option<String>What is being deprecated (e.g., “old_fn()” or “old_fn(arg)”). Auto-inferred from function name if not provided.
with: Option<String>Replacement to suggest (e.g., “new_fn()”).
details: Option<String>Additional details message.
id: Option<String>Unique ID for lifecycle deprecation tracking.
Implementations§
Source§impl LifecycleSpec
impl LifecycleSpec
Sourcepub fn new(stage: LifecycleStage) -> Self
pub fn new(stage: LifecycleStage) -> Self
Create a new lifecycle spec with the given stage and no additional metadata.
Sourcepub fn from_deprecated(since: Option<&str>, note: Option<&str>) -> Self
pub fn from_deprecated(since: Option<&str>, note: Option<&str>) -> Self
Create a lifecycle spec from a Rust #[deprecated] attribute.
Maps the since field to when and attempts to parse the note field
for a “use X instead” pattern to populate with. The full note is also
stored in details.
Sourcepub fn r_prelude(&self, fn_name: &str) -> Option<String>
pub fn r_prelude(&self, fn_name: &str) -> Option<String>
Generate the R prelude code for lifecycle signaling.
Returns a single line of R code to insert at the start of the function body,
or None for Stable stage. The fn_name is used as the what argument
if no explicit what was provided.
For experimental/superseded: lifecycle::signal_stage("stage", "fn_name()").
For deprecated variants: lifecycle::deprecate_*(when, what, with, details, id).
Trait Implementations§
Source§impl Clone for LifecycleSpec
impl Clone for LifecycleSpec
Source§fn clone(&self) -> LifecycleSpec
fn clone(&self) -> LifecycleSpec
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LifecycleSpec
impl Debug for LifecycleSpec
Source§impl Default for LifecycleSpec
impl Default for LifecycleSpec
Source§fn default() -> LifecycleSpec
fn default() -> LifecycleSpec
Auto Trait Implementations§
impl Freeze for LifecycleSpec
impl RefUnwindSafe for LifecycleSpec
impl Send for LifecycleSpec
impl Sync for LifecycleSpec
impl Unpin for LifecycleSpec
impl UnsafeUnpin for LifecycleSpec
impl UnwindSafe for LifecycleSpec
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> SizedTypeProperties for T
impl<T> SizedTypeProperties for T
Source§#[doc(hidden)]const SIZE: usize = _
#[doc(hidden)]const SIZE: usize = _
sized_type_properties)Source§#[doc(hidden)]const ALIGN: usize = _
#[doc(hidden)]const ALIGN: usize = _
sized_type_properties)Source§#[doc(hidden)]const ALIGNMENT: Alignment = _
#[doc(hidden)]const ALIGNMENT: Alignment = _
ptr_alignment_type)Source§#[doc(hidden)]const IS_ZST: bool = _
#[doc(hidden)]const IS_ZST: bool = _
sized_type_properties)Source§#[doc(hidden)]const LAYOUT: Layout = _
#[doc(hidden)]const LAYOUT: Layout = _
sized_type_properties)Source§#[doc(hidden)]const MAX_SLICE_LEN: usize = _
#[doc(hidden)]const MAX_SLICE_LEN: usize = _
sized_type_properties)[Self]. Read moreLayout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 128 bytes