Trait shipyard::IntoBorrow

source ·
pub trait IntoBorrow {
    type Borrow: for<'a> Borrow<'a>;
}
Expand description

Transforms a view into a helper type. This allows workloads to have the current syntax.

§Example of manual implementation:

use shipyard::{IntoBorrow, View, UniqueView};

struct CameraView<'v> {
    camera: UniqueView<'v, Camera>,
    position: View<'v, Position>,
}
// There shouldn't be any lifetime on this struct.
// If the custom view has generics, PhantomData can be used to make the compiler happy.
struct CameraViewBorrower {}

impl IntoBorrow for CameraView<'_> {
    type Borrow = CameraViewBorrower;
}

Required Associated Types§

source

type Borrow: for<'a> Borrow<'a>

Helper type almost allowing GAT on stable.

Implementations on Foreign Types§

source§

impl IntoBorrow for ()

source§

impl<A: IntoBorrow> IntoBorrow for (A,)

§

type Borrow = (<A as IntoBorrow>::Borrow,)

source§

impl<A: IntoBorrow, B: IntoBorrow> IntoBorrow for (A, B)

§

type Borrow = (<A as IntoBorrow>::Borrow, <B as IntoBorrow>::Borrow)

source§

impl<A: IntoBorrow, B: IntoBorrow, C: IntoBorrow> IntoBorrow for (A, B, C)

§

type Borrow = (<A as IntoBorrow>::Borrow, <B as IntoBorrow>::Borrow, <C as IntoBorrow>::Borrow)

source§

impl<A: IntoBorrow, B: IntoBorrow, C: IntoBorrow, D: IntoBorrow> IntoBorrow for (A, B, C, D)

§

type Borrow = (<A as IntoBorrow>::Borrow, <B as IntoBorrow>::Borrow, <C as IntoBorrow>::Borrow, <D as IntoBorrow>::Borrow)

source§

impl<A: IntoBorrow, B: IntoBorrow, C: IntoBorrow, D: IntoBorrow, E: IntoBorrow> IntoBorrow for (A, B, C, D, E)

§

type Borrow = (<A as IntoBorrow>::Borrow, <B as IntoBorrow>::Borrow, <C as IntoBorrow>::Borrow, <D as IntoBorrow>::Borrow, <E as IntoBorrow>::Borrow)

source§

impl<A: IntoBorrow, B: IntoBorrow, C: IntoBorrow, D: IntoBorrow, E: IntoBorrow, F: IntoBorrow> IntoBorrow for (A, B, C, D, E, F)

§

type Borrow = (<A as IntoBorrow>::Borrow, <B as IntoBorrow>::Borrow, <C as IntoBorrow>::Borrow, <D as IntoBorrow>::Borrow, <E as IntoBorrow>::Borrow, <F as IntoBorrow>::Borrow)

source§

impl<A: IntoBorrow, B: IntoBorrow, C: IntoBorrow, D: IntoBorrow, E: IntoBorrow, F: IntoBorrow, G: IntoBorrow> IntoBorrow for (A, B, C, D, E, F, G)

§

type Borrow = (<A as IntoBorrow>::Borrow, <B as IntoBorrow>::Borrow, <C as IntoBorrow>::Borrow, <D as IntoBorrow>::Borrow, <E as IntoBorrow>::Borrow, <F as IntoBorrow>::Borrow, <G as IntoBorrow>::Borrow)

source§

impl<A: IntoBorrow, B: IntoBorrow, C: IntoBorrow, D: IntoBorrow, E: IntoBorrow, F: IntoBorrow, G: IntoBorrow, H: IntoBorrow> IntoBorrow for (A, B, C, D, E, F, G, H)

§

type Borrow = (<A as IntoBorrow>::Borrow, <B as IntoBorrow>::Borrow, <C as IntoBorrow>::Borrow, <D as IntoBorrow>::Borrow, <E as IntoBorrow>::Borrow, <F as IntoBorrow>::Borrow, <G as IntoBorrow>::Borrow, <H as IntoBorrow>::Borrow)

source§

impl<A: IntoBorrow, B: IntoBorrow, C: IntoBorrow, D: IntoBorrow, E: IntoBorrow, F: IntoBorrow, G: IntoBorrow, H: IntoBorrow, I: IntoBorrow> IntoBorrow for (A, B, C, D, E, F, G, H, I)

§

type Borrow = (<A as IntoBorrow>::Borrow, <B as IntoBorrow>::Borrow, <C as IntoBorrow>::Borrow, <D as IntoBorrow>::Borrow, <E as IntoBorrow>::Borrow, <F as IntoBorrow>::Borrow, <G as IntoBorrow>::Borrow, <H as IntoBorrow>::Borrow, <I as IntoBorrow>::Borrow)

source§

impl<A: IntoBorrow, B: IntoBorrow, C: IntoBorrow, D: IntoBorrow, E: IntoBorrow, F: IntoBorrow, G: IntoBorrow, H: IntoBorrow, I: IntoBorrow, J: IntoBorrow> IntoBorrow for (A, B, C, D, E, F, G, H, I, J)

§

type Borrow = (<A as IntoBorrow>::Borrow, <B as IntoBorrow>::Borrow, <C as IntoBorrow>::Borrow, <D as IntoBorrow>::Borrow, <E as IntoBorrow>::Borrow, <F as IntoBorrow>::Borrow, <G as IntoBorrow>::Borrow, <H as IntoBorrow>::Borrow, <I as IntoBorrow>::Borrow, <J as IntoBorrow>::Borrow)

source§

impl<T: IntoBorrow> IntoBorrow for Option<T>

Implementors§

source§

impl IntoBorrow for AllStoragesView<'_>

source§

impl IntoBorrow for AllStoragesViewMut<'_>

source§

impl IntoBorrow for EntitiesView<'_>

source§

impl IntoBorrow for EntitiesViewMut<'_>

source§

impl<T: Send + Sync + Component> IntoBorrow for View<'_, T>
where T::Tracking: Send + Sync,

source§

impl<T: Send + Sync + Component> IntoBorrow for ViewMut<'_, T>
where T::Tracking: Send + Sync,

source§

impl<T: Send + Sync + Unique> IntoBorrow for UniqueView<'_, T>

source§

impl<T: Send + Sync + Unique> IntoBorrow for UniqueViewMut<'_, T>

source§

impl<T: Send + Component> IntoBorrow for NonSync<View<'_, T>>
where T::Tracking: Send,

source§

impl<T: Send + Component> IntoBorrow for NonSync<ViewMut<'_, T>>
where T::Tracking: Send,

source§

impl<T: Send + Unique> IntoBorrow for NonSync<UniqueView<'_, T>>

source§

impl<T: Send + Unique> IntoBorrow for NonSync<UniqueViewMut<'_, T>>

source§

impl<T: Sync + Component> IntoBorrow for NonSend<View<'_, T>>
where T::Tracking: Sync,

source§

impl<T: Sync + Component> IntoBorrow for NonSend<ViewMut<'_, T>>
where T::Tracking: Sync,

source§

impl<T: Sync + Unique> IntoBorrow for NonSend<UniqueView<'_, T>>

source§

impl<T: Sync + Unique> IntoBorrow for NonSend<UniqueViewMut<'_, T>>

source§

impl<T: Component> IntoBorrow for NonSendSync<View<'_, T>>

source§

impl<T: Component> IntoBorrow for NonSendSync<ViewMut<'_, T>>

source§

impl<T: Unique> IntoBorrow for NonSendSync<UniqueView<'_, T>>

source§

impl<T: Unique> IntoBorrow for NonSendSync<UniqueViewMut<'_, T>>