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

Helper type almost allowing GAT on stable.

Implementations on Foreign Types

Implementors