#[repr(C)]pub struct ComponentEntry {
pub name: &'static str,
pub stage: InitStage,
pub init_fn: fn() -> Result<(), ComponentInitError>,
pub path: &'static str,
pub priority: u32,
pub depends_on: &'static [&'static str],
}Expand description
Entry placed in .component_entries by #[init_component].
All fields are 'static because this struct lives in a #[used] static.
§Memory layout
#[repr(C)] ensures a stable layout so the linker-section scan in
init_all() can iterate entries with ptr::add(1).
Fields§
§name: &'static strFunction name as written in source — used for dependency resolution.
stage: InitStageLifecycle stage this component belongs to.
init_fn: fn() -> Result<(), ComponentInitError>The registered initializer.
path: &'static str"file!():fn_name" — for log messages only.
priority: u32Lower value = earlier init within the same topological level.
depends_on: &'static [&'static str]Names of same-stage functions that must complete before this one.
Implementations§
Auto Trait Implementations§
impl Freeze for ComponentEntry
impl RefUnwindSafe for ComponentEntry
impl Send for ComponentEntry
impl Sync for ComponentEntry
impl Unpin for ComponentEntry
impl UnsafeUnpin for ComponentEntry
impl UnwindSafe for ComponentEntry
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