Struct r3_core::bind::BindRef

source ·
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,

Materializes BindRef<System, T> as &'static T. Can only be consumed by executables and not by bindings.

§

type Runtime = BindRef<System, T>

The runtime representation of Self. Read more
source§

const fn register_dependency(&self, ctx: &mut CfgBindCtx<'_>)

Define a binding dependency in CfgBindCtx::bind_registry. Read more
source§

const fn into_runtime_binder(self) -> Self::Runtime

Convert self to the runtime representation (RuntimeBinder). Read more
source§

impl<System, T> Clone for BindRef<System, T>

source§

const fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<System, T> Index<BindRef<System, T>> for BindTable<System>where System: KernelBase + KernelStatic, T: 'static,

§

type Output = T

The returned type after indexing.
source§

fn index(&self, index: BindRef<System, T>) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
source§

impl<T, System> RuntimeBinder for BindRef<System, T>where T: 'static, System: KernelBase + KernelStatic,

§

type Target<'call> = &'static T

The materialized form.
source§

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
source§

impl<System, T> Copy for BindRef<System, T>

Auto Trait Implementations§

§

impl<System, T> !RefUnwindSafe for BindRef<System, T>

§

impl<System, T> Send for BindRef<System, T>

§

impl<System, T> Sync for BindRef<System, T>

§

impl<System, T> Unpin for BindRef<System, T>where System: Unpin,

§

impl<System, T> !UnwindSafe for BindRef<System, T>

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.