pub struct Sprite<Userdata = (), Api = Default, const FREE_ON_DROP: bool = true>(/* private fields */)
where
Api: Api;
Implementations§
source§impl<UD, Api> Sprite<UD, Api>where
Api: Api + Copy,
impl<UD, Api> Sprite<UD, Api>where
Api: Api + Copy,
Convert this sprite into the same sprite that will not be freed on drop. That means that only C-part of the sprite will be freed.
Safety is guaranteed by the caller.
source§impl<UD, Api, const FOD: bool> Sprite<UD, Api, FOD>where
Api: Api,
impl<UD, Api, const FOD: bool> Sprite<UD, Api, FOD>where
Api: Api,
sourcepub fn new_with(api: Api) -> Sprite<UD, Api, FOD>
pub fn new_with(api: Api) -> Sprite<UD, Api, FOD>
Allocates and returns a new Sprite with given api
.
See also sys::ffi::playdate_sprite::newSprite
source§impl<Userdata, Api, const FOD: bool> Sprite<Userdata, Api, FOD>where
Api: Api,
impl<Userdata, Api, const FOD: bool> Sprite<Userdata, Api, FOD>where
Api: Api,
sourcepub fn add(&self)
pub fn add(&self)
Adds the this sprite to the display list, so that it is drawn in the current scene.
Equivalent to sys::ffi::playdate_sprite::addSprite
sourcepub fn remove(&self)
pub fn remove(&self)
Removes the this sprite from the display list.
Equivalent to sys::ffi::playdate_sprite::removeSprite
sourcepub fn set_bounds(&self, bounds: PDRect)
pub fn set_bounds(&self, bounds: PDRect)
Sets the bounds of the sprite with bounds.
Equivalent to sys::ffi::playdate_sprite::setBounds
sourcepub fn bounds(&self) -> PDRect
pub fn bounds(&self) -> PDRect
Returns the bounds of the sprite.
Equivalent to sys::ffi::playdate_sprite::getBounds
sourcepub fn move_to(&self, x: f32, y: f32)
pub fn move_to(&self, x: f32, y: f32)
Moves the sprite to x
, y
and resets its bounds based on the bitmap dimensions and center.
Equivalent to sys::ffi::playdate_sprite::moveTo
sourcepub fn move_by(&self, dx: f32, dy: f32)
pub fn move_by(&self, dx: f32, dy: f32)
Moves the sprite to by offsetting its current position by dx
, dy
.
Equivalent to sys::ffi::playdate_sprite::moveBy
sourcepub fn set_image(&self, image: impl AnyBitmap, flip: LCDBitmapFlip)
pub fn set_image(&self, image: impl AnyBitmap, flip: LCDBitmapFlip)
Sets the sprite’s image to the given bitmap.
⚠️ Caution: Using with draw function, call this method before set callback. Setting image after setting draw callback is mostly crashes with SIGBUS.
See also set_opaque
.
Equivalent to sys::ffi::playdate_sprite::setImage
sourcepub fn image<'t>(&'t self) -> Option<BitmapRef<'t>>
pub fn image<'t>(&'t self) -> Option<BitmapRef<'t>>
Returns the bitmap currently assigned to the given sprite.
Equivalent to sys::ffi::playdate_sprite::getImage
sourcepub fn set_size(&self, width: f32, height: f32)
pub fn set_size(&self, width: f32, height: f32)
Sets the size.
The size is used to set the sprite’s bounds when calling move_to
.
Equivalent to sys::ffi::playdate_sprite::setSize
sourcepub fn set_z_index(&self, z_index: i16)
pub fn set_z_index(&self, z_index: i16)
Sets the Z order of the sprite. Higher Z sprites are drawn on top of those with lower Z order.
Equivalent to sys::ffi::playdate_sprite::setZIndex
sourcepub fn z_index(&self) -> i16
pub fn z_index(&self) -> i16
Returns the Z index of the sprite.
Equivalent to sys::ffi::playdate_sprite::getZIndex
sourcepub fn set_draw_mode(&self, mode: LCDBitmapDrawMode)
pub fn set_draw_mode(&self, mode: LCDBitmapDrawMode)
Sets the mode for drawing the sprite’s bitmap.
Equivalent to sys::ffi::playdate_sprite::setDrawMode
sourcepub fn set_image_flip(&self, flip: LCDBitmapFlip)
pub fn set_image_flip(&self, flip: LCDBitmapFlip)
Flips the sprite’s bitmap.
Equivalent to sys::ffi::playdate_sprite::setImageFlip
sourcepub fn image_flip(&self) -> LCDBitmapFlip
pub fn image_flip(&self) -> LCDBitmapFlip
Returns the flip setting of the sprite’s bitmap.
Equivalent to sys::ffi::playdate_sprite::getImageFlip
sourcepub fn set_stencil(&self, stencil: impl AnyBitmap)
pub fn set_stencil(&self, stencil: impl AnyBitmap)
Specifies a stencil image to be set on the frame buffer before the sprite is drawn.
Equivalent to sys::ffi::playdate_sprite::setStencil
sourcepub fn set_clip_rect(&self, clip: LCDRect)
pub fn set_clip_rect(&self, clip: LCDRect)
Sets the clipping rectangle for sprite drawing.
Equivalent to sys::ffi::playdate_sprite::setClipRect
sourcepub fn clear_clip_rect(&self)
pub fn clear_clip_rect(&self)
Clears the sprite’s clipping rectangle.
Equivalent to sys::ffi::playdate_sprite::clearClipRect
sourcepub fn set_updates_enabled(&self, value: bool)
pub fn set_updates_enabled(&self, value: bool)
Set the updates_enabled
flag of the sprite
(determines whether the sprite has its update function called).
Equivalent to sys::ffi::playdate_sprite::setUpdatesEnabled
sourcepub fn updates_enabled(&self) -> bool
pub fn updates_enabled(&self) -> bool
Get the updates_enabled
flag of the sprite.
Equivalent to sys::ffi::playdate_sprite::updatesEnabled
sourcepub fn set_collisions_enabled(&self, value: bool)
pub fn set_collisions_enabled(&self, value: bool)
Set the collisions_enabled flag of the sprite
(along with the collide_rect
, this determines whether the sprite participates in collisions).
Set to true
by default.
See also collide_rect
,
set_collide_rect
,
clear_collide_rect
.
Equivalent to sys::ffi::playdate_sprite::setCollisionsEnabled
sourcepub fn collisions_enabled(&self) -> bool
pub fn collisions_enabled(&self) -> bool
Get the collisions_enabled
flag of the sprite.
Equivalent to sys::ffi::playdate_sprite::collisionsEnabled
sourcepub fn set_visible(&self, value: bool)
pub fn set_visible(&self, value: bool)
Set the visible flag of the given sprite (determines whether the sprite has its draw function called).
Equivalent to sys::ffi::playdate_sprite::setVisible
sourcepub fn is_visible(&self) -> bool
pub fn is_visible(&self) -> bool
Get the visible flag of the sprite.
Equivalent to sys::ffi::playdate_sprite::isVisible
sourcepub fn set_opaque(&self, value: bool)
pub fn set_opaque(&self, value: bool)
Marking a sprite opaque tells the sprite system that it doesn’t need to draw anything underneath the sprite, since it will be overdrawn anyway.
If you set an image without a mask/alpha channel on the sprite, it automatically sets the opaque flag.
Equivalent to sys::ffi::playdate_sprite::setOpaque
sourcepub fn mark_dirty(&self)
pub fn mark_dirty(&self)
Forces the sprite to redraw.
Equivalent to sys::ffi::playdate_sprite::markDirty
sourcepub fn set_tag(&self, tag: u8)
pub fn set_tag(&self, tag: u8)
Sets the tag of the sprite.
This can be useful for identifying sprites or types of sprites when using the collision API.
Equivalent to sys::ffi::playdate_sprite::setTag
sourcepub fn tag(&self) -> u8
pub fn tag(&self) -> u8
Returns the tag of the given sprite.
Equivalent to sys::ffi::playdate_sprite::getTag
sourcepub fn set_ignores_draw_offset(&self, value: bool)
pub fn set_ignores_draw_offset(&self, value: bool)
When flag is set to true
,
the sprite will draw in screen coordinates,
ignoring the currently-set draw_offset
.
This only affects drawing, and should not be used on sprites being used for collisions, which will still happen in world-space.
See also gfx::set_draw_offset
.
Equivalent to sys::ffi::playdate_sprite::setIgnoresDrawOffset
sourcepub fn position(&self) -> (f32, f32)
pub fn position(&self) -> (f32, f32)
Sets x
and y
to the current position of sprite.
Equivalent to get_position_to
and sys::ffi::playdate_sprite::getPosition
sourcepub fn position_to(&self, x: &mut f32, y: &mut f32)
pub fn position_to(&self, x: &mut f32, y: &mut f32)
Sets x
and y
to the current position of sprite.
Equivalent to sys::ffi::playdate_sprite::getPosition
sourcepub fn set_collide_rect(&self, collide: PDRect)
pub fn set_collide_rect(&self, collide: PDRect)
Marks the area of the sprite, relative to its bounds, to be checked for collisions with other sprites’ collide rects.
Equivalent to sys::ffi::playdate_sprite::setCollideRect
sourcepub fn collide_rect(&self) -> PDRect
pub fn collide_rect(&self) -> PDRect
Returns the sprite’s collide rect.
Equivalent to sys::ffi::playdate_sprite::getCollideRect
sourcepub fn clear_collide_rect(&self)
pub fn clear_collide_rect(&self)
Clears the sprite’s collide rect.
Equivalent to sys::ffi::playdate_sprite::clearCollideRect
sourcepub fn check_collisions(
&self,
goal_x: f32,
goal_y: f32,
actual_x: &mut f32,
actual_y: &mut f32
) -> &[SpriteCollisionInfo]
pub fn check_collisions( &self, goal_x: f32, goal_y: f32, actual_x: &mut f32, actual_y: &mut f32 ) -> &[SpriteCollisionInfo]
Returns the same values as [move_with_collisions
] but does not actually move the sprite.
Equivalent to sys::ffi::playdate_sprite::checkCollisions
sourcepub fn move_with_collisions<'t>(
&'t self,
goal_x: f32,
goal_y: f32,
actual_x: &mut f32,
actual_y: &mut f32
) -> &'t [SpriteCollisionInfo]
pub fn move_with_collisions<'t>( &'t self, goal_x: f32, goal_y: f32, actual_x: &mut f32, actual_y: &mut f32 ) -> &'t [SpriteCollisionInfo]
Moves the sprite towards goal_x
, goal_y
taking collisions into account
and returns a slice of SpriteCollisionInfo
.
actual_x
, actual_y
are set to the sprite’s position after collisions.
If no collisions occurred, this will be the same as goal_x
, goal_y
.
Resulting slice with entire content can be freely dropped.
Equivalent to sys::ffi::playdate_sprite::moveWithCollisions
sourcepub fn overlapping_sprites(&self) -> &[SpriteRef]
pub fn overlapping_sprites(&self) -> &[SpriteRef]
Returns an slice of sprites that have collide rects that are currently overlapping the given sprite’s collide rect.
Equivalent to sys::ffi::playdate_sprite::overlappingSprites
sourcepub fn set_stencil_pattern(&self, pattern: &mut [u8; 8])
pub fn set_stencil_pattern(&self, pattern: &mut [u8; 8])
Sets the sprite’s stencil to the given pattern.
Equivalent to sys::ffi::playdate_sprite::setStencilPattern
sourcepub fn set_stencil_image(&self, stencil: impl AnyBitmap, tile: bool)
pub fn set_stencil_image(&self, stencil: impl AnyBitmap, tile: bool)
Specifies a stencil image to be set on the frame buffer before the sprite is drawn.
If tile is set, the stencil will be tiled.
Tiled stencils must have width evenly divisible by 32.
Equivalent to sys::ffi::playdate_sprite::setStencilImage
sourcepub fn clear_stencil(&self)
pub fn clear_stencil(&self)
Clears the sprite’s stencil.
Equivalent to sys::ffi::playdate_sprite::clearStencil
sourcepub fn set_center(&self, x: f32, y: f32)
pub fn set_center(&self, x: f32, y: f32)
Sets the sprite’s drawing center as a fraction (ranging from 0.0
to 1.0
) of the height and width.
Default is 0.5, 0.5
(the center of the sprite).
This means that when you call Sprite::move_to
(x, y)
,
the center of your sprite will be positioned at x, y
.
If you want x
and y
to represent the upper left corner of your sprite, specify the center as 0, 0
.
Equivalent to sys::ffi::playdate_sprite::setCenter
.
sourcepub fn center(&self) -> (f32, f32)
pub fn center(&self) -> (f32, f32)
Returns the sprite’s drawing center as a fraction (ranging from 0.0
to 1.0
) of the height and width.
Equivalent to sys::ffi::playdate_sprite::getCenter
.
sourcepub fn set_userdata(&self, data: Userdata)
pub fn set_userdata(&self, data: Userdata)
Sets custom data to the sprite.
Used for associating the sprite with other data.
Equivalent to sys::ffi::playdate_sprite::setUserdata
sourcepub fn userdata(&self) -> Option<&mut Userdata>
pub fn userdata(&self) -> Option<&mut Userdata>
Gets the mutable_ reference to sprite’s userdata.
Used for associating the sprite with other data.
Equivalent to sys::ffi::playdate_sprite::getUserdata
source§impl<UD, Api, const FOD: bool> Sprite<UD, Api, FOD>where
Api: Api,
impl<UD, Api, const FOD: bool> Sprite<UD, Api, FOD>where
Api: Api,
sourcepub fn into_draw_handler<T>(self) -> Handle<FOD, Sprite<UD, Api, FOD>, T>
pub fn into_draw_handler<T>(self) -> Handle<FOD, Sprite<UD, Api, FOD>, T>
Sets the draw function for the this sprite.
⚠️ Caution:
Do not forget to set bounds
before setting draw function,
default zero bounds causes UB in the system.
source§impl<UD, Api, const FOD: bool> Sprite<UD, Api, FOD>where
Api: Api,
impl<UD, Api, const FOD: bool> Sprite<UD, Api, FOD>where
Api: Api,
sourcepub fn into_update_handler<T>(self) -> Handle<FOD, Sprite<UD, Api, FOD>, T>
pub fn into_update_handler<T>(self) -> Handle<FOD, Sprite<UD, Api, FOD>, T>
Sets the update function for the this sprite.
Trait Implementations§
source§impl<const FOD: bool, T, H> AsMut<Sprite<<T as TypedSprite>::Userdata, <T as SpriteApi>::Api, FOD>> for Handle<FOD, T, H>where
T: TypedSprite + AsMut<Sprite<<T as TypedSprite>::Userdata, <T as SpriteApi>::Api, FOD>>,
H: SpriteCollisionResponse,
impl<const FOD: bool, T, H> AsMut<Sprite<<T as TypedSprite>::Userdata, <T as SpriteApi>::Api, FOD>> for Handle<FOD, T, H>where
T: TypedSprite + AsMut<Sprite<<T as TypedSprite>::Userdata, <T as SpriteApi>::Api, FOD>>,
H: SpriteCollisionResponse,
source§impl<const FOD: bool, T, H> AsMut<Sprite<<T as TypedSprite>::Userdata, <T as SpriteApi>::Api, FOD>> for Handle<FOD, T, H>where
T: TypedSprite + AsMut<Sprite<<T as TypedSprite>::Userdata, <T as SpriteApi>::Api, FOD>>,
H: SpriteDraw,
impl<const FOD: bool, T, H> AsMut<Sprite<<T as TypedSprite>::Userdata, <T as SpriteApi>::Api, FOD>> for Handle<FOD, T, H>where
T: TypedSprite + AsMut<Sprite<<T as TypedSprite>::Userdata, <T as SpriteApi>::Api, FOD>>,
H: SpriteDraw,
source§impl<const FOD: bool, T, H> AsMut<Sprite<<T as TypedSprite>::Userdata, <T as SpriteApi>::Api, FOD>> for Handle<FOD, T, H>where
T: TypedSprite + AsMut<Sprite<<T as TypedSprite>::Userdata, <T as SpriteApi>::Api, FOD>>,
H: SpriteUpdate,
impl<const FOD: bool, T, H> AsMut<Sprite<<T as TypedSprite>::Userdata, <T as SpriteApi>::Api, FOD>> for Handle<FOD, T, H>where
T: TypedSprite + AsMut<Sprite<<T as TypedSprite>::Userdata, <T as SpriteApi>::Api, FOD>>,
H: SpriteUpdate,
source§impl<UD, Api, const FOD: bool> AsMut<Sprite<UD, Api, FOD>> for Sprite<UD, Api, FOD>where
Api: Api,
impl<UD, Api, const FOD: bool> AsMut<Sprite<UD, Api, FOD>> for Sprite<UD, Api, FOD>where
Api: Api,
source§impl<const FOD: bool, Sp, T, H> AsRef<Sprite<<Sp as TypedSprite>::Userdata, <Sp as SpriteApi>::Api, FOD>> for Handle<FOD, Sp, T, H>where
T: AsRef<Sprite<<Sp as TypedSprite>::Userdata, <Sp as SpriteApi>::Api, FOD>>,
Sp: TypedSprite,
H: SpriteDraw,
impl<const FOD: bool, Sp, T, H> AsRef<Sprite<<Sp as TypedSprite>::Userdata, <Sp as SpriteApi>::Api, FOD>> for Handle<FOD, Sp, T, H>where
T: AsRef<Sprite<<Sp as TypedSprite>::Userdata, <Sp as SpriteApi>::Api, FOD>>,
Sp: TypedSprite,
H: SpriteDraw,
source§impl<const FOD: bool, Sp, T, H> AsRef<Sprite<<Sp as TypedSprite>::Userdata, <Sp as SpriteApi>::Api, FOD>> for Handle<FOD, Sp, T, H>where
T: AsRef<Sprite<<Sp as TypedSprite>::Userdata, <Sp as SpriteApi>::Api, FOD>>,
Sp: TypedSprite,
H: SpriteCollisionResponse,
impl<const FOD: bool, Sp, T, H> AsRef<Sprite<<Sp as TypedSprite>::Userdata, <Sp as SpriteApi>::Api, FOD>> for Handle<FOD, Sp, T, H>where
T: AsRef<Sprite<<Sp as TypedSprite>::Userdata, <Sp as SpriteApi>::Api, FOD>>,
Sp: TypedSprite,
H: SpriteCollisionResponse,
source§impl<const FOD: bool, Sp, T, H> AsRef<Sprite<<Sp as TypedSprite>::Userdata, <Sp as SpriteApi>::Api, FOD>> for Handle<FOD, Sp, T, H>where
T: AsRef<Sprite<<Sp as TypedSprite>::Userdata, <Sp as SpriteApi>::Api, FOD>>,
Sp: TypedSprite,
H: SpriteUpdate,
impl<const FOD: bool, Sp, T, H> AsRef<Sprite<<Sp as TypedSprite>::Userdata, <Sp as SpriteApi>::Api, FOD>> for Handle<FOD, Sp, T, H>where
T: AsRef<Sprite<<Sp as TypedSprite>::Userdata, <Sp as SpriteApi>::Api, FOD>>,
Sp: TypedSprite,
H: SpriteUpdate,
source§impl<const FOD: bool, T, H> AsRef<Sprite<<T as TypedSprite>::Userdata, <T as SpriteApi>::Api, FOD>> for Handle<FOD, T, H>where
T: TypedSprite + AsRef<Sprite<<T as TypedSprite>::Userdata, <T as SpriteApi>::Api, FOD>>,
H: SpriteDraw,
impl<const FOD: bool, T, H> AsRef<Sprite<<T as TypedSprite>::Userdata, <T as SpriteApi>::Api, FOD>> for Handle<FOD, T, H>where
T: TypedSprite + AsRef<Sprite<<T as TypedSprite>::Userdata, <T as SpriteApi>::Api, FOD>>,
H: SpriteDraw,
source§impl<const FOD: bool, T, H> AsRef<Sprite<<T as TypedSprite>::Userdata, <T as SpriteApi>::Api, FOD>> for Handle<FOD, T, H>where
T: TypedSprite + AsRef<Sprite<<T as TypedSprite>::Userdata, <T as SpriteApi>::Api, FOD>>,
H: SpriteCollisionResponse,
impl<const FOD: bool, T, H> AsRef<Sprite<<T as TypedSprite>::Userdata, <T as SpriteApi>::Api, FOD>> for Handle<FOD, T, H>where
T: TypedSprite + AsRef<Sprite<<T as TypedSprite>::Userdata, <T as SpriteApi>::Api, FOD>>,
H: SpriteCollisionResponse,
source§impl<const FOD: bool, T, H> AsRef<Sprite<<T as TypedSprite>::Userdata, <T as SpriteApi>::Api, FOD>> for Handle<FOD, T, H>where
T: TypedSprite + AsRef<Sprite<<T as TypedSprite>::Userdata, <T as SpriteApi>::Api, FOD>>,
H: SpriteUpdate,
impl<const FOD: bool, T, H> AsRef<Sprite<<T as TypedSprite>::Userdata, <T as SpriteApi>::Api, FOD>> for Handle<FOD, T, H>where
T: TypedSprite + AsRef<Sprite<<T as TypedSprite>::Userdata, <T as SpriteApi>::Api, FOD>>,
H: SpriteUpdate,
source§impl<UD, Api, const FOD: bool> AsRef<Sprite<UD, Api, FOD>> for Sprite<UD, Api, FOD>where
Api: Api,
impl<UD, Api, const FOD: bool> AsRef<Sprite<UD, Api, FOD>> for Sprite<UD, Api, FOD>where
Api: Api,
source§impl<Userdata, Api, const FREE_ON_DROP: bool> Debug for Sprite<Userdata, Api, FREE_ON_DROP>where
Userdata: Debug,
Api: Debug + Api,
impl<Userdata, Api, const FREE_ON_DROP: bool> Debug for Sprite<Userdata, Api, FREE_ON_DROP>where
Userdata: Debug,
Api: Debug + Api,
source§impl<UD, Api, const FOD: bool> From<SpriteRef> for Sprite<UD, Api, FOD>where
Api: Api + Default,
impl<UD, Api, const FOD: bool> From<SpriteRef> for Sprite<UD, Api, FOD>where
Api: Api + Default,
source§impl<UD, Api, const FOD: bool> TypedSprite for Sprite<UD, Api, FOD>where
Api: Api,
impl<UD, Api, const FOD: bool> TypedSprite for Sprite<UD, Api, FOD>where
Api: Api,
source§const FREE_ON_DROP: bool = FOD
const FREE_ON_DROP: bool = FOD
impl<UD, Api, const FOD: bool> AnySprite for Sprite<UD, Api, FOD>where
Api: Api,
Auto Trait Implementations§
impl<Userdata, Api, const FREE_ON_DROP: bool> Freeze for Sprite<Userdata, Api, FREE_ON_DROP>where
Api: Freeze,
impl<Userdata, Api, const FREE_ON_DROP: bool> RefUnwindSafe for Sprite<Userdata, Api, FREE_ON_DROP>where
Api: RefUnwindSafe,
Userdata: RefUnwindSafe,
impl<Userdata = (), Api = Default, const FREE_ON_DROP: bool = true> !Send for Sprite<Userdata, Api, FREE_ON_DROP>
impl<Userdata = (), Api = Default, const FREE_ON_DROP: bool = true> !Sync for Sprite<Userdata, Api, FREE_ON_DROP>
impl<Userdata, Api, const FREE_ON_DROP: bool> Unpin for Sprite<Userdata, Api, FREE_ON_DROP>where
Api: Unpin,
Userdata: Unpin,
impl<Userdata, Api, const FREE_ON_DROP: bool> UnwindSafe for Sprite<Userdata, Api, FREE_ON_DROP>where
Api: UnwindSafe,
Userdata: UnwindSafe,
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T, U> Into<U> for Twhere
U: From<T>,
impl<T, U> Into<U> for Twhere
U: From<T>,
source§impl<T> SpriteType for Twhere
T: TypedSprite,
impl<T> SpriteType for Twhere
T: TypedSprite,
§impl<T> ToOwned for Twhere
T: Clone,
impl<T> ToOwned for Twhere
T: Clone,
§impl<T, U> TryFrom<U> for Twhere
U: Into<T>,
impl<T, U> TryFrom<U> for Twhere
U: Into<T>,
Layout§
Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.