Struct r3::bind::Bind

source ·
pub struct Bind<'pool, System, T> { /* private fields */ }
Expand description

A defined binding.

The configuration-time metadata is stored in a pool with lifetime 'pool.

Implementations§

source§

impl<'pool, System> Bind<'pool, System, ()>

source

pub const fn define() -> BindDefiner<System, BinderUnspecified, FuncUnspecified>

Construct a BindDefiner to define a binding in a configuration function.

source§

impl<'pool, System, T> Bind<'pool, System, T>

Binders

The following methods are used to construct a binder, which is a reference to a binding with a specific borrowing mode.

source

pub const fn borrow(&self) -> BindBorrow<'pool, System, T>where T: Sync,

Create a BindBorrow binder, which gives &T to a bound function.

source

pub const fn borrow_mut(&self) -> BindBorrowMut<'pool, System, T>where T: Send,

Create a BindBorrowMut binder, which gives &mut T to a bound function.

source

pub const fn take(&self) -> BindTake<'pool, System, T>where T: Send,

Create a BindTake binder, which gives T to a bound function.

source

pub const fn take_ref(&self) -> BindTakeRef<'pool, System, T>where T: Sync,

Create a BindTakeRef binder, which gives &'static T to a bound function.

source

pub const fn take_mut(&self) -> BindTakeMut<'pool, System, T>where T: Send,

Create a BindTakeMut binder, which gives &'static mut T to a bound function.

source

pub const fn as_ref(&self) -> BindRef<System, T>where T: Sync,

Construct a BindRef, which can be used to get &'static T from a BindTable<System>.

BindRef doubles as a binder that gives &'static T in a bound executable object.

The configuration system can’t track the usages of BindRef (note the lack of a lifetime parameter in its definition). As such, merely calling this method counts as a use of the binding whether the returned BindRef is actually used or not.

source§

impl<'pool, System, T> Bind<'pool, System, T>

source

pub const fn hunk(&self) -> Hunk<System, BindData<T>>

Get the raw Hunk providing the backing store for this binding.

The referent type of the returned Hunk is an opaque type that has the same representation as T (because of #[repr(transparent)]). You can use Hunk::transmute to reinterpret it as you see fit.

Calling this method alone does not extend the binding’s lifetime nor prevent conflicting borrows from occurring. A dummy binding can be used to express the manner in which the raw hunk is used outside the configuration system’s knowledge. For example, if the raw hunk is going to be mutably borrowed, the caller of this method should create a dummy unpure binding that consumes the binding by take_mut.

Trait Implementations§

source§

impl<System, T> Clone for Bind<'_, System, T>

source§

const fn clone(&self) -> Bind<'_, System, T>

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<'pool, const LEN: usize, System, T> UnzipBind for Bind<'pool, System, [T; LEN]>

§

type Target = [Bind<'pool, System, T>; LEN]

source§

const fn unzip(self) -> <Bind<'pool, System, [T; LEN]> as UnzipBind>::Target

Destruct Bind into individual bindings.
source§

impl<'pool, System> UnzipBind for Bind<'pool, System, ()>

§

type Target = ()

source§

const fn unzip(self) -> <Bind<'pool, System, ()> as UnzipBind>::Target

Destruct Bind into individual bindings.
source§

impl<'pool, System, Field0> UnzipBind for Bind<'pool, System, (Field0,)>

§

type Target = (Bind<'pool, System, Field0>,)

source§

const fn unzip(self) -> <Bind<'pool, System, (Field0,)> as UnzipBind>::Target

Destruct Bind into individual bindings.
source§

impl<'pool, System, Field0, Field1> UnzipBind for Bind<'pool, System, (Field0, Field1)>

§

type Target = (Bind<'pool, System, Field0>, Bind<'pool, System, Field1>)

source§

const fn unzip( self ) -> <Bind<'pool, System, (Field0, Field1)> as UnzipBind>::Target

Destruct Bind into individual bindings.
source§

impl<'pool, System, Field0, Field1, Field2> UnzipBind for Bind<'pool, System, (Field0, Field1, Field2)>

§

type Target = (Bind<'pool, System, Field0>, Bind<'pool, System, Field1>, Bind<'pool, System, Field2>)

source§

const fn unzip( self ) -> <Bind<'pool, System, (Field0, Field1, Field2)> as UnzipBind>::Target

Destruct Bind into individual bindings.
source§

impl<'pool, System, Field0, Field1, Field2, Field3> UnzipBind for Bind<'pool, System, (Field0, Field1, Field2, Field3)>

§

type Target = (Bind<'pool, System, Field0>, Bind<'pool, System, Field1>, Bind<'pool, System, Field2>, Bind<'pool, System, Field3>)

source§

const fn unzip( self ) -> <Bind<'pool, System, (Field0, Field1, Field2, Field3)> as UnzipBind>::Target

Destruct Bind into individual bindings.
source§

impl<'pool, System, Field0, Field1, Field2, Field3, Field4> UnzipBind for Bind<'pool, System, (Field0, Field1, Field2, Field3, Field4)>

§

type Target = (Bind<'pool, System, Field0>, Bind<'pool, System, Field1>, Bind<'pool, System, Field2>, Bind<'pool, System, Field3>, Bind<'pool, System, Field4>)

source§

const fn unzip( self ) -> <Bind<'pool, System, (Field0, Field1, Field2, Field3, Field4)> as UnzipBind>::Target

Destruct Bind into individual bindings.
source§

impl<'pool, System, Field0, Field1, Field2, Field3, Field4, Field5> UnzipBind for Bind<'pool, System, (Field0, Field1, Field2, Field3, Field4, Field5)>

§

type Target = (Bind<'pool, System, Field0>, Bind<'pool, System, Field1>, Bind<'pool, System, Field2>, Bind<'pool, System, Field3>, Bind<'pool, System, Field4>, Bind<'pool, System, Field5>)

source§

const fn unzip( self ) -> <Bind<'pool, System, (Field0, Field1, Field2, Field3, Field4, Field5)> as UnzipBind>::Target

Destruct Bind into individual bindings.
source§

impl<'pool, System, Field0, Field1, Field2, Field3, Field4, Field5, Field6> UnzipBind for Bind<'pool, System, (Field0, Field1, Field2, Field3, Field4, Field5, Field6)>

§

type Target = (Bind<'pool, System, Field0>, Bind<'pool, System, Field1>, Bind<'pool, System, Field2>, Bind<'pool, System, Field3>, Bind<'pool, System, Field4>, Bind<'pool, System, Field5>, Bind<'pool, System, Field6>)

source§

const fn unzip( self ) -> <Bind<'pool, System, (Field0, Field1, Field2, Field3, Field4, Field5, Field6)> as UnzipBind>::Target

Destruct Bind into individual bindings.
source§

impl<'pool, System, Field0, Field1, Field2, Field3, Field4, Field5, Field6, Field7> UnzipBind for Bind<'pool, System, (Field0, Field1, Field2, Field3, Field4, Field5, Field6, Field7)>

§

type Target = (Bind<'pool, System, Field0>, Bind<'pool, System, Field1>, Bind<'pool, System, Field2>, Bind<'pool, System, Field3>, Bind<'pool, System, Field4>, Bind<'pool, System, Field5>, Bind<'pool, System, Field6>, Bind<'pool, System, Field7>)

source§

const fn unzip( self ) -> <Bind<'pool, System, (Field0, Field1, Field2, Field3, Field4, Field5, Field6, Field7)> as UnzipBind>::Target

Destruct Bind into individual bindings.
source§

impl<'pool, System, Field0, Field1, Field2, Field3, Field4, Field5, Field6, Field7, Field8> UnzipBind for Bind<'pool, System, (Field0, Field1, Field2, Field3, Field4, Field5, Field6, Field7, Field8)>

§

type Target = (Bind<'pool, System, Field0>, Bind<'pool, System, Field1>, Bind<'pool, System, Field2>, Bind<'pool, System, Field3>, Bind<'pool, System, Field4>, Bind<'pool, System, Field5>, Bind<'pool, System, Field6>, Bind<'pool, System, Field7>, Bind<'pool, System, Field8>)

source§

const fn unzip( self ) -> <Bind<'pool, System, (Field0, Field1, Field2, Field3, Field4, Field5, Field6, Field7, Field8)> as UnzipBind>::Target

Destruct Bind into individual bindings.
source§

impl<'pool, System, Field0, Field1, Field2, Field3, Field4, Field5, Field6, Field7, Field8, Field9> UnzipBind for Bind<'pool, System, (Field0, Field1, Field2, Field3, Field4, Field5, Field6, Field7, Field8, Field9)>

§

type Target = (Bind<'pool, System, Field0>, Bind<'pool, System, Field1>, Bind<'pool, System, Field2>, Bind<'pool, System, Field3>, Bind<'pool, System, Field4>, Bind<'pool, System, Field5>, Bind<'pool, System, Field6>, Bind<'pool, System, Field7>, Bind<'pool, System, Field8>, Bind<'pool, System, Field9>)

source§

const fn unzip( self ) -> <Bind<'pool, System, (Field0, Field1, Field2, Field3, Field4, Field5, Field6, Field7, Field8, Field9)> as UnzipBind>::Target

Destruct Bind into individual bindings.
source§

impl<'pool, System, Field0, Field1, Field2, Field3, Field4, Field5, Field6, Field7, Field8, Field9, Field10> UnzipBind for Bind<'pool, System, (Field0, Field1, Field2, Field3, Field4, Field5, Field6, Field7, Field8, Field9, Field10)>

§

type Target = (Bind<'pool, System, Field0>, Bind<'pool, System, Field1>, Bind<'pool, System, Field2>, Bind<'pool, System, Field3>, Bind<'pool, System, Field4>, Bind<'pool, System, Field5>, Bind<'pool, System, Field6>, Bind<'pool, System, Field7>, Bind<'pool, System, Field8>, Bind<'pool, System, Field9>, Bind<'pool, System, Field10>)

source§

const fn unzip( self ) -> <Bind<'pool, System, (Field0, Field1, Field2, Field3, Field4, Field5, Field6, Field7, Field8, Field9, Field10)> as UnzipBind>::Target

Destruct Bind into individual bindings.
source§

impl<'pool, System, Field0, Field1, Field2, Field3, Field4, Field5, Field6, Field7, Field8, Field9, Field10, Field11> UnzipBind for Bind<'pool, System, (Field0, Field1, Field2, Field3, Field4, Field5, Field6, Field7, Field8, Field9, Field10, Field11)>

§

type Target = (Bind<'pool, System, Field0>, Bind<'pool, System, Field1>, Bind<'pool, System, Field2>, Bind<'pool, System, Field3>, Bind<'pool, System, Field4>, Bind<'pool, System, Field5>, Bind<'pool, System, Field6>, Bind<'pool, System, Field7>, Bind<'pool, System, Field8>, Bind<'pool, System, Field9>, Bind<'pool, System, Field10>, Bind<'pool, System, Field11>)

source§

const fn unzip( self ) -> <Bind<'pool, System, (Field0, Field1, Field2, Field3, Field4, Field5, Field6, Field7, Field8, Field9, Field10, Field11)> as UnzipBind>::Target

Destruct Bind into individual bindings.
source§

impl<'pool, System, Field0, Field1, Field2, Field3, Field4, Field5, Field6, Field7, Field8, Field9, Field10, Field11, Field12> UnzipBind for Bind<'pool, System, (Field0, Field1, Field2, Field3, Field4, Field5, Field6, Field7, Field8, Field9, Field10, Field11, Field12)>

§

type Target = (Bind<'pool, System, Field0>, Bind<'pool, System, Field1>, Bind<'pool, System, Field2>, Bind<'pool, System, Field3>, Bind<'pool, System, Field4>, Bind<'pool, System, Field5>, Bind<'pool, System, Field6>, Bind<'pool, System, Field7>, Bind<'pool, System, Field8>, Bind<'pool, System, Field9>, Bind<'pool, System, Field10>, Bind<'pool, System, Field11>, Bind<'pool, System, Field12>)

source§

const fn unzip( self ) -> <Bind<'pool, System, (Field0, Field1, Field2, Field3, Field4, Field5, Field6, Field7, Field8, Field9, Field10, Field11, Field12)> as UnzipBind>::Target

Destruct Bind into individual bindings.
source§

impl<'pool, System, Field0, Field1, Field2, Field3, Field4, Field5, Field6, Field7, Field8, Field9, Field10, Field11, Field12, Field13> UnzipBind for Bind<'pool, System, (Field0, Field1, Field2, Field3, Field4, Field5, Field6, Field7, Field8, Field9, Field10, Field11, Field12, Field13)>

§

type Target = (Bind<'pool, System, Field0>, Bind<'pool, System, Field1>, Bind<'pool, System, Field2>, Bind<'pool, System, Field3>, Bind<'pool, System, Field4>, Bind<'pool, System, Field5>, Bind<'pool, System, Field6>, Bind<'pool, System, Field7>, Bind<'pool, System, Field8>, Bind<'pool, System, Field9>, Bind<'pool, System, Field10>, Bind<'pool, System, Field11>, Bind<'pool, System, Field12>, Bind<'pool, System, Field13>)

source§

const fn unzip( self ) -> <Bind<'pool, System, (Field0, Field1, Field2, Field3, Field4, Field5, Field6, Field7, Field8, Field9, Field10, Field11, Field12, Field13)> as UnzipBind>::Target

Destruct Bind into individual bindings.
source§

impl<'pool, System, Field0, Field1, Field2, Field3, Field4, Field5, Field6, Field7, Field8, Field9, Field10, Field11, Field12, Field13, Field14> UnzipBind for Bind<'pool, System, (Field0, Field1, Field2, Field3, Field4, Field5, Field6, Field7, Field8, Field9, Field10, Field11, Field12, Field13, Field14)>

§

type Target = (Bind<'pool, System, Field0>, Bind<'pool, System, Field1>, Bind<'pool, System, Field2>, Bind<'pool, System, Field3>, Bind<'pool, System, Field4>, Bind<'pool, System, Field5>, Bind<'pool, System, Field6>, Bind<'pool, System, Field7>, Bind<'pool, System, Field8>, Bind<'pool, System, Field9>, Bind<'pool, System, Field10>, Bind<'pool, System, Field11>, Bind<'pool, System, Field12>, Bind<'pool, System, Field13>, Bind<'pool, System, Field14>)

source§

const fn unzip( self ) -> <Bind<'pool, System, (Field0, Field1, Field2, Field3, Field4, Field5, Field6, Field7, Field8, Field9, Field10, Field11, Field12, Field13, Field14)> as UnzipBind>::Target

Destruct Bind into individual bindings.
source§

impl<System, T> Copy for Bind<'_, System, T>

Auto Trait Implementations§

§

impl<'pool, System, T> !RefUnwindSafe for Bind<'pool, System, T>

§

impl<'pool, System, T> !Send for Bind<'pool, System, T>

§

impl<'pool, System, T> !Sync for Bind<'pool, System, T>

§

impl<'pool, System, T> Unpin for Bind<'pool, System, T>where System: Unpin,

§

impl<'pool, System, T> !UnwindSafe for Bind<'pool, 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.