Struct r3_core::bind::BindDefiner
source · pub struct BindDefiner<System, Binder, Func> { /* private fields */ }Expand description
The definer (static builder) for Bind.
Implementations§
source§impl<System> BindDefiner<System, BinderUnspecified, FuncUnspecified>
impl<System> BindDefiner<System, BinderUnspecified, FuncUnspecified>
Specifying the initializer function
One of the following methods should be used to specify the initializer for the binding being defined.
sourcepub const fn init<Func>(self, func: Func) -> BindDefiner<System, (), Func>
pub const fn init<Func>(self, func: Func) -> BindDefiner<System, (), Func>
Use the function to initialize the binding contents.
sourcepub const fn init_with_bind<Binder, Func>(
self,
binder: Binder,
func: Func
) -> BindDefiner<System, Binder, Func>
pub const fn init_with_bind<Binder, Func>( self, binder: Binder, func: Func ) -> BindDefiner<System, Binder, Func>
Use the function with dependency to initialize the binding contents.
sourcepub const fn zeroed<T: Zeroable>(
self
) -> BindDefiner<System, (), FnBindNever<T>>
pub const fn zeroed<T: Zeroable>( self ) -> BindDefiner<System, (), FnBindNever<T>>
Zero-initialize the binding contents.
sourcepub const unsafe fn zeroed_unchecked<T>(
self
) -> BindDefiner<System, (), FnBindNever<T>>
pub const unsafe fn zeroed_unchecked<T>( self ) -> BindDefiner<System, (), FnBindNever<T>>
Zero-initialize the binding contents even if it might be unsafe.
Safety
If zero initialization is not a valid bit pattern for T, accessing the
contents may result in an undefined behavior.
sourcepub const unsafe fn uninit_unchecked<T>(
self
) -> BindDefiner<System, (), FnBindNever<T>>
pub const unsafe fn uninit_unchecked<T>( self ) -> BindDefiner<System, (), FnBindNever<T>>
Skip the initialization of the binding contents even if it might be unsafe.
Safety
If the uninitialized state is not valid for T, accessing the
contents may result in an undefined behavior.
source§impl<System, Binder, Func> BindDefiner<System, Binder, Func>
impl<System, Binder, Func> BindDefiner<System, Binder, Func>
source§impl<System, Binder, Func> BindDefiner<System, Binder, Func>
impl<System, Binder, Func> BindDefiner<System, Binder, Func>
Finalization
The following method defines a binding using the provided parameter.
sourcepub const fn finish<'pool, C>(
self,
cfg: &mut Cfg<'pool, C>
) -> Bind<'pool, System, <Func as FnBind<Binder>>::Output>where
C: CfgBase<System = System>,
System: KernelBase + KernelStatic,
Func: FnBind<Binder>,
pub const fn finish<'pool, C>( self, cfg: &mut Cfg<'pool, C> ) -> Bind<'pool, System, <Func as FnBind<Binder>>::Output>where C: CfgBase<System = System>, System: KernelBase + KernelStatic, Func: FnBind<Binder>,
Complete the definition of a binding, returning a reference to it.