Struct r3_core::bind::BindDefiner
source · [−]pub struct BindDefiner<System, Binder, Func> { /* private fields */ }
Expand description
The definer (static builder) for Bind
.
Implementations
sourceimpl<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: ZeroInit>(
self
) -> BindDefiner<System, (), FnBindNever<T>>
pub const fn zeroed<T: ZeroInit>(
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.
sourceimpl<System, Binder, Func> BindDefiner<System, Binder, Func>
impl<System, Binder, Func> BindDefiner<System, Binder, Func>
sourceimpl<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.
Auto Trait Implementations
impl<System, Binder, Func> RefUnwindSafe for BindDefiner<System, Binder, Func> where
Binder: RefUnwindSafe,
Func: RefUnwindSafe,
impl<System, Binder, Func> Send for BindDefiner<System, Binder, Func> where
Binder: Send,
Func: Send,
impl<System, Binder, Func> Sync for BindDefiner<System, Binder, Func> where
Binder: Sync,
Func: Sync,
impl<System, Binder, Func> Unpin for BindDefiner<System, Binder, Func> where
Binder: Unpin,
Func: Unpin,
impl<System, Binder, Func> UnwindSafe for BindDefiner<System, Binder, Func> where
Binder: UnwindSafe,
Func: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more