pub struct BindRef<System, T>(_);
Expand description
A reference to a binding. Doubles as a binder.
Created by Bind::as_ref
.
It doesn’t provide access to the contents by itself because it could be
used before the binding is initialized. Index BindTable
by this type to
borrow the contents as &'static T
.
Trait Implementations§
source§impl<T, System> Binder for BindRef<System, T>where
T: 'static,
System: KernelBase + KernelStatic,
impl<T, System> Binder for BindRef<System, T>where T: 'static, System: KernelBase + KernelStatic,
Materializes BindRef<System, T>
as &'static T
. Can only be consumed by
executables and not by bindings.
source§const fn register_dependency(&self, ctx: &mut CfgBindCtx<'_>)
const fn register_dependency(&self, ctx: &mut CfgBindCtx<'_>)
Define a binding dependency in
CfgBindCtx::bind_registry
. Read moresource§const fn into_runtime_binder(self) -> Self::Runtime
const fn into_runtime_binder(self) -> Self::Runtime
source§impl<System, T> Index<BindRef<System, T>> for BindTable<System>where
System: KernelBase + KernelStatic,
T: 'static,
impl<System, T> Index<BindRef<System, T>> for BindTable<System>where System: KernelBase + KernelStatic, T: 'static,
source§impl<T, System> RuntimeBinder for BindRef<System, T>where
T: 'static,
System: KernelBase + KernelStatic,
impl<T, System> RuntimeBinder for BindRef<System, T>where T: 'static, System: KernelBase + KernelStatic,
§type Target<'call> = &'static T
type Target<'call> = &'static T
The materialized form.
source§unsafe fn materialize<'call>(self) -> Self::Target<'call>
unsafe fn materialize<'call>(self) -> Self::Target<'call>
Construct a target object at runtime, using the intermediate product
constructed by
Binder::into_runtime_binder
. Read more