pub struct StartupHookDefiner<System> { /* private fields */ }
Expand description

The definer (static builder) for StartupHook.

Implementations§

source§

impl<System> StartupHookDefiner<System>where System: KernelBase,

source

pub const fn start<C>(self, start: C) -> StartupHookDefiner<System>where C: IntoClosureConst,

[Required] Specify the entry point.

source

pub const fn priority(self, priority: i32) -> StartupHookDefiner<System>

Specify the priority. Defaults to 0 when unspecified.

Startup hooks will execute in the ascending order of priority. Startup hooks with identical priority values will execute in the registration order.

priority must not be negative. This limitation can be relaxed by calling Self::unchecked.

source

pub const unsafe fn unchecked(self) -> StartupHookDefiner<System>

Allow the use of a negative priority value.

Safety

Startup hooks with negative priority values can rely on their execution order for memory safety.

source

pub const fn finish<C>(self, cfg: &mut Cfg<'_, C>) -> StartupHook<System>where C: CfgBase<System = System>,

Complete the registration of a startup hook, returning an StartupHook object.

Auto Trait Implementations§

§

impl<System> RefUnwindSafe for StartupHookDefiner<System>

§

impl<System> Send for StartupHookDefiner<System>

§

impl<System> Sync for StartupHookDefiner<System>

§

impl<System> Unpin for StartupHookDefiner<System>

§

impl<System> UnwindSafe for StartupHookDefiner<System>

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.