pub trait Device: VkHandle<Handle = VkDevice> + InstanceChild {
Show 36 methods
// Provided methods
fn queue<'s>(
&'s self,
family_index: u32,
queue_index: u32,
) -> QueueObject<&'s Self> { ... }
fn new_fence_raw(
&self,
info: &FenceCreateInfo<'_>,
allocation_callbacks: Option<&VkAllocationCallbacks>,
) -> Result<VkFence> { ... }
fn new_semaphore_raw(
&self,
info: &SemaphoreCreateInfo<'_>,
allocation_callbacks: Option<&VkAllocationCallbacks>,
) -> Result<VkSemaphore> { ... }
fn new_event_raw(
&self,
info: &EventCreateInfo,
allocation_callbacks: Option<&VkAllocationCallbacks>,
) -> Result<VkEvent> { ... }
fn allocate_memory(
&self,
info: &MemoryAllocateInfo<'_>,
allocation_callbacks: Option<&VkAllocationCallbacks>,
) -> Result<VkDeviceMemory> { ... }
fn new_buffer_raw(
&self,
info: &BufferCreateInfo<'_>,
allocation_callbacks: Option<&VkAllocationCallbacks>,
) -> Result<VkBuffer> { ... }
fn new_buffer_view_raw(
&self,
info: &BufferViewCreateInfo<'_>,
allocation_callbacks: Option<&VkAllocationCallbacks>,
) -> Result<VkBufferView> { ... }
fn new_sampler_raw(
&self,
info: &SamplerCreateInfo,
allocation_callbacks: Option<&VkAllocationCallbacks>,
) -> Result<VkSampler> { ... }
fn new_image_raw(
&self,
info: &ImageCreateInfo<'_>,
allocation_callbacks: Option<&VkAllocationCallbacks>,
) -> Result<VkImage> { ... }
fn new_image_view_raw(
&self,
info: &ImageViewCreateInfo<'_>,
allocation_callbacks: Option<&VkAllocationCallbacks>,
) -> Result<VkImageView> { ... }
fn new_render_pass(
&self,
info: &RenderPassCreateInfo<'_>,
allocation_callbacks: Option<&VkAllocationCallbacks>,
) -> Result<VkRenderPass> { ... }
fn new_framebuffer_raw(
&self,
info: &FramebufferCreateInfo<'_, '_>,
allocation_callbacks: Option<&VkAllocationCallbacks>,
) -> Result<VkFramebuffer> { ... }
fn new_shader_module_raw(
&self,
info: &ShaderModuleCreateInfo<'_>,
allocation_callbacks: Option<&VkAllocationCallbacks>,
) -> Result<VkShaderModule> { ... }
fn new_pipeline_cache_raw(
&self,
info: &PipelineCacheCreateInfo<'_>,
allocation_callbacks: Option<&VkAllocationCallbacks>,
) -> Result<VkPipelineCache> { ... }
fn new_pipeline_layout_raw(
&self,
info: &PipelineLayoutCreateInfo<'_>,
allocation_callbacks: Option<&VkAllocationCallbacks>,
) -> Result<VkPipelineLayout> { ... }
unsafe fn new_graphics_pipelines_raw(
&self,
infos: &[GraphicsPipelineCreateInfo<'_>],
cache: Option<VkPipelineCache>,
allocation_callbacks: Option<&VkAllocationCallbacks>,
objects: &mut [VkPipeline],
) -> Result<()> { ... }
fn new_graphics_pipelines<'s>(
&'s self,
infos: &[GraphicsPipelineCreateInfo<'_>],
cache: Option<&(impl VkHandle<Handle = VkPipelineCache> + ?Sized)>,
) -> Result<Vec<PipelineObject<&'s Self>>> { ... }
fn new_graphics_pipeline_array<'s, const N: usize>(
&'s self,
infos: &[GraphicsPipelineCreateInfo<'_>; N],
cache: Option<&(impl VkHandle<Handle = VkPipelineCache> + ?Sized)>,
) -> Result<[PipelineObject<&'s Self>; N]> { ... }
unsafe fn new_compute_pipelines_raw(
&self,
infos: &[ComputePipelineCreateInfo<'_>],
cache: Option<VkPipelineCache>,
allocation_callbacks: Option<&VkAllocationCallbacks>,
objects: &mut [VkPipeline],
) -> Result<()> { ... }
fn new_compute_pipelines<'s>(
&'s self,
infos: &[ComputePipelineCreateInfo<'_>],
cache: Option<&(impl VkHandle<Handle = VkPipelineCache> + ?Sized)>,
) -> Result<Vec<PipelineObject<&'s Self>>> { ... }
fn new_compute_pipeline_array<'s, const N: usize>(
&'s self,
infos: &[ComputePipelineCreateInfo<'_>; N],
cache: Option<&(impl VkHandle<Handle = VkPipelineCache> + ?Sized)>,
) -> Result<[PipelineObject<&'s Self>; N]> { ... }
fn new_command_pool_raw(
&self,
info: &CommandPoolCreateInfo,
allocation_callbacks: Option<&VkAllocationCallbacks>,
) -> Result<VkCommandPool> { ... }
fn new_query_pool_raw(
&self,
info: &QueryPoolCreateInfo,
allocation_callbacks: Option<&VkAllocationCallbacks>,
) -> Result<VkQueryPool> { ... }
unsafe fn allocate_command_buffers<'s>(
&'s self,
info: &CommandBufferAllocateInfo<'_>,
sink: &mut [MaybeUninit<CommandBufferObject<&'s Self>>],
) -> Result<()> { ... }
unsafe fn allocate_command_buffers_alloc<'s>(
&'s self,
info: &CommandBufferAllocateInfo<'_>,
) -> Result<Vec<CommandBufferObject<&'s Self>>> { ... }
unsafe fn allocate_command_buffer_array<'s, const N: usize>(
&'s self,
info: &CommandBufferFixedCountAllocateInfo<'_, N>,
) -> Result<[CommandBufferObject<&'s Self>; N]> { ... }
unsafe fn invalidate_memory_range(
&self,
ranges: &[MappedMemoryRange<'_>],
) -> Result<()> { ... }
unsafe fn flush_mapped_memory_ranges(
&self,
ranges: &[MappedMemoryRange<'_>],
) -> Result<()> { ... }
unsafe fn update_descriptor_sets_raw(
&self,
writes: &[VkWriteDescriptorSet],
copies: &[VkCopyDescriptorSet],
) { ... }
fn update_descriptor_sets(
&self,
writes: &[DescriptorSetWriteInfo<'_>],
copies: &[DescriptorSetCopyInfo],
) { ... }
unsafe fn wait(&self) -> Result<()> { ... }
unsafe fn bind_buffer_raw(
&self,
buffer: VkBuffer,
memory: VkDeviceMemory,
offset: VkDeviceSize,
) -> Result<()> { ... }
unsafe fn bind_image_raw(
&self,
image: VkImage,
memory: VkDeviceMemory,
offset: VkDeviceSize,
) -> Result<()> { ... }
fn wait_multiple_fences(
&self,
objects: &[VkHandleRef<'_, VkFence>],
wait_all: bool,
timeout: Option<u64>,
) -> Result<bool> { ... }
fn reset_multiple_fences(
&self,
objects: &[VkHandleRefMut<'_, VkFence>],
) -> Result<()> { ... }
fn new_swapchain_raw(
&self,
info: &SwapchainCreateInfo<'_, '_, '_>,
allocation_callbacks: Option<&VkAllocationCallbacks>,
) -> Result<VkSwapchainKHR> { ... }
}Provided Methods§
Sourcefn queue<'s>(
&'s self,
family_index: u32,
queue_index: u32,
) -> QueueObject<&'s Self>
fn queue<'s>( &'s self, family_index: u32, queue_index: u32, ) -> QueueObject<&'s Self>
Get a queue handle from a device
Sourcefn new_fence_raw(
&self,
info: &FenceCreateInfo<'_>,
allocation_callbacks: Option<&VkAllocationCallbacks>,
) -> Result<VkFence>
fn new_fence_raw( &self, info: &FenceCreateInfo<'_>, allocation_callbacks: Option<&VkAllocationCallbacks>, ) -> Result<VkFence>
Sourcefn new_semaphore_raw(
&self,
info: &SemaphoreCreateInfo<'_>,
allocation_callbacks: Option<&VkAllocationCallbacks>,
) -> Result<VkSemaphore>
fn new_semaphore_raw( &self, info: &SemaphoreCreateInfo<'_>, allocation_callbacks: Option<&VkAllocationCallbacks>, ) -> Result<VkSemaphore>
Sourcefn new_event_raw(
&self,
info: &EventCreateInfo,
allocation_callbacks: Option<&VkAllocationCallbacks>,
) -> Result<VkEvent>
fn new_event_raw( &self, info: &EventCreateInfo, allocation_callbacks: Option<&VkAllocationCallbacks>, ) -> Result<VkEvent>
Sourcefn allocate_memory(
&self,
info: &MemoryAllocateInfo<'_>,
allocation_callbacks: Option<&VkAllocationCallbacks>,
) -> Result<VkDeviceMemory>
fn allocate_memory( &self, info: &MemoryAllocateInfo<'_>, allocation_callbacks: Option<&VkAllocationCallbacks>, ) -> Result<VkDeviceMemory>
Allocate device memory
§Failure
On failure, this command returns
VK_ERROR_OUT_OF_HOST_MEMORYVK_ERROR_OUT_OF_DEVICE_MEMORY- [
VK_ERROR_INVALID_EXTERNAL_HANDLE] - [
VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS_KHR]
Sourcefn new_buffer_raw(
&self,
info: &BufferCreateInfo<'_>,
allocation_callbacks: Option<&VkAllocationCallbacks>,
) -> Result<VkBuffer>
fn new_buffer_raw( &self, info: &BufferCreateInfo<'_>, allocation_callbacks: Option<&VkAllocationCallbacks>, ) -> Result<VkBuffer>
Sourcefn new_buffer_view_raw(
&self,
info: &BufferViewCreateInfo<'_>,
allocation_callbacks: Option<&VkAllocationCallbacks>,
) -> Result<VkBufferView>
fn new_buffer_view_raw( &self, info: &BufferViewCreateInfo<'_>, allocation_callbacks: Option<&VkAllocationCallbacks>, ) -> Result<VkBufferView>
Sourcefn new_sampler_raw(
&self,
info: &SamplerCreateInfo,
allocation_callbacks: Option<&VkAllocationCallbacks>,
) -> Result<VkSampler>
fn new_sampler_raw( &self, info: &SamplerCreateInfo, allocation_callbacks: Option<&VkAllocationCallbacks>, ) -> Result<VkSampler>
Sourcefn new_image_raw(
&self,
info: &ImageCreateInfo<'_>,
allocation_callbacks: Option<&VkAllocationCallbacks>,
) -> Result<VkImage>
fn new_image_raw( &self, info: &ImageCreateInfo<'_>, allocation_callbacks: Option<&VkAllocationCallbacks>, ) -> Result<VkImage>
Create a new image object
§Failure
On failure, this command returns
VK_ERROR_OUT_OF_HOST_MEMORYVK_ERROR_OUT_OF_DEVICE_MEMORY- [
VK_ERROR_COMPRESSION_EXHAUSTED_EXT] - [
VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS_KHR]
Sourcefn new_image_view_raw(
&self,
info: &ImageViewCreateInfo<'_>,
allocation_callbacks: Option<&VkAllocationCallbacks>,
) -> Result<VkImageView>
fn new_image_view_raw( &self, info: &ImageViewCreateInfo<'_>, allocation_callbacks: Option<&VkAllocationCallbacks>, ) -> Result<VkImageView>
Create a new image view from an existing image
§Failure
On failure, this command returns
VK_ERROR_OUT_OF_HOST_MEMORYVK_ERROR_OUT_OF_DEVICE_MEMORY- [
VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS_KHR]
Sourcefn new_render_pass(
&self,
info: &RenderPassCreateInfo<'_>,
allocation_callbacks: Option<&VkAllocationCallbacks>,
) -> Result<VkRenderPass>
fn new_render_pass( &self, info: &RenderPassCreateInfo<'_>, allocation_callbacks: Option<&VkAllocationCallbacks>, ) -> Result<VkRenderPass>
Sourcefn new_framebuffer_raw(
&self,
info: &FramebufferCreateInfo<'_, '_>,
allocation_callbacks: Option<&VkAllocationCallbacks>,
) -> Result<VkFramebuffer>
fn new_framebuffer_raw( &self, info: &FramebufferCreateInfo<'_, '_>, allocation_callbacks: Option<&VkAllocationCallbacks>, ) -> Result<VkFramebuffer>
Sourcefn new_shader_module_raw(
&self,
info: &ShaderModuleCreateInfo<'_>,
allocation_callbacks: Option<&VkAllocationCallbacks>,
) -> Result<VkShaderModule>
fn new_shader_module_raw( &self, info: &ShaderModuleCreateInfo<'_>, allocation_callbacks: Option<&VkAllocationCallbacks>, ) -> Result<VkShaderModule>
Sourcefn new_pipeline_cache_raw(
&self,
info: &PipelineCacheCreateInfo<'_>,
allocation_callbacks: Option<&VkAllocationCallbacks>,
) -> Result<VkPipelineCache>
fn new_pipeline_cache_raw( &self, info: &PipelineCacheCreateInfo<'_>, allocation_callbacks: Option<&VkAllocationCallbacks>, ) -> Result<VkPipelineCache>
Sourcefn new_pipeline_layout_raw(
&self,
info: &PipelineLayoutCreateInfo<'_>,
allocation_callbacks: Option<&VkAllocationCallbacks>,
) -> Result<VkPipelineLayout>
fn new_pipeline_layout_raw( &self, info: &PipelineLayoutCreateInfo<'_>, allocation_callbacks: Option<&VkAllocationCallbacks>, ) -> Result<VkPipelineLayout>
Sourceunsafe fn new_graphics_pipelines_raw(
&self,
infos: &[GraphicsPipelineCreateInfo<'_>],
cache: Option<VkPipelineCache>,
allocation_callbacks: Option<&VkAllocationCallbacks>,
objects: &mut [VkPipeline],
) -> Result<()>
unsafe fn new_graphics_pipelines_raw( &self, infos: &[GraphicsPipelineCreateInfo<'_>], cache: Option<VkPipelineCache>, allocation_callbacks: Option<&VkAllocationCallbacks>, objects: &mut [VkPipeline], ) -> Result<()>
Sourcefn new_graphics_pipelines<'s>(
&'s self,
infos: &[GraphicsPipelineCreateInfo<'_>],
cache: Option<&(impl VkHandle<Handle = VkPipelineCache> + ?Sized)>,
) -> Result<Vec<PipelineObject<&'s Self>>>
fn new_graphics_pipelines<'s>( &'s self, infos: &[GraphicsPipelineCreateInfo<'_>], cache: Option<&(impl VkHandle<Handle = VkPipelineCache> + ?Sized)>, ) -> Result<Vec<PipelineObject<&'s Self>>>
Create graphics pipelines
§Failures
On failure, this command returns
VK_ERROR_OUT_OF_HOST_MEMORYVK_ERROR_OUT_OF_DEVICE_MEMORY
Sourcefn new_graphics_pipeline_array<'s, const N: usize>(
&'s self,
infos: &[GraphicsPipelineCreateInfo<'_>; N],
cache: Option<&(impl VkHandle<Handle = VkPipelineCache> + ?Sized)>,
) -> Result<[PipelineObject<&'s Self>; N]>
fn new_graphics_pipeline_array<'s, const N: usize>( &'s self, infos: &[GraphicsPipelineCreateInfo<'_>; N], cache: Option<&(impl VkHandle<Handle = VkPipelineCache> + ?Sized)>, ) -> Result<[PipelineObject<&'s Self>; N]>
Create graphics pipelines
§Failures
On failure, this command returns
VK_ERROR_OUT_OF_HOST_MEMORYVK_ERROR_OUT_OF_DEVICE_MEMORY
Sourceunsafe fn new_compute_pipelines_raw(
&self,
infos: &[ComputePipelineCreateInfo<'_>],
cache: Option<VkPipelineCache>,
allocation_callbacks: Option<&VkAllocationCallbacks>,
objects: &mut [VkPipeline],
) -> Result<()>
unsafe fn new_compute_pipelines_raw( &self, infos: &[ComputePipelineCreateInfo<'_>], cache: Option<VkPipelineCache>, allocation_callbacks: Option<&VkAllocationCallbacks>, objects: &mut [VkPipeline], ) -> Result<()>
Sourcefn new_compute_pipelines<'s>(
&'s self,
infos: &[ComputePipelineCreateInfo<'_>],
cache: Option<&(impl VkHandle<Handle = VkPipelineCache> + ?Sized)>,
) -> Result<Vec<PipelineObject<&'s Self>>>
fn new_compute_pipelines<'s>( &'s self, infos: &[ComputePipelineCreateInfo<'_>], cache: Option<&(impl VkHandle<Handle = VkPipelineCache> + ?Sized)>, ) -> Result<Vec<PipelineObject<&'s Self>>>
Create compute pipelines
§Failures
On failure, this command returns
VK_ERROR_OUT_OF_HOST_MEMORYVK_ERROR_OUT_OF_DEVICE_MEMORY
Sourcefn new_compute_pipeline_array<'s, const N: usize>(
&'s self,
infos: &[ComputePipelineCreateInfo<'_>; N],
cache: Option<&(impl VkHandle<Handle = VkPipelineCache> + ?Sized)>,
) -> Result<[PipelineObject<&'s Self>; N]>
fn new_compute_pipeline_array<'s, const N: usize>( &'s self, infos: &[ComputePipelineCreateInfo<'_>; N], cache: Option<&(impl VkHandle<Handle = VkPipelineCache> + ?Sized)>, ) -> Result<[PipelineObject<&'s Self>; N]>
Create compute pipelines
§Failures
On failure, this command returns
VK_ERROR_OUT_OF_HOST_MEMORYVK_ERROR_OUT_OF_DEVICE_MEMORY
Sourcefn new_command_pool_raw(
&self,
info: &CommandPoolCreateInfo,
allocation_callbacks: Option<&VkAllocationCallbacks>,
) -> Result<VkCommandPool>
fn new_command_pool_raw( &self, info: &CommandPoolCreateInfo, allocation_callbacks: Option<&VkAllocationCallbacks>, ) -> Result<VkCommandPool>
Sourcefn new_query_pool_raw(
&self,
info: &QueryPoolCreateInfo,
allocation_callbacks: Option<&VkAllocationCallbacks>,
) -> Result<VkQueryPool>
fn new_query_pool_raw( &self, info: &QueryPoolCreateInfo, allocation_callbacks: Option<&VkAllocationCallbacks>, ) -> Result<VkQueryPool>
Sourceunsafe fn allocate_command_buffers<'s>(
&'s self,
info: &CommandBufferAllocateInfo<'_>,
sink: &mut [MaybeUninit<CommandBufferObject<&'s Self>>],
) -> Result<()>
unsafe fn allocate_command_buffers<'s>( &'s self, info: &CommandBufferAllocateInfo<'_>, sink: &mut [MaybeUninit<CommandBufferObject<&'s Self>>], ) -> Result<()>
Sourceunsafe fn allocate_command_buffers_alloc<'s>(
&'s self,
info: &CommandBufferAllocateInfo<'_>,
) -> Result<Vec<CommandBufferObject<&'s Self>>>
unsafe fn allocate_command_buffers_alloc<'s>( &'s self, info: &CommandBufferAllocateInfo<'_>, ) -> Result<Vec<CommandBufferObject<&'s Self>>>
Sourceunsafe fn allocate_command_buffer_array<'s, const N: usize>(
&'s self,
info: &CommandBufferFixedCountAllocateInfo<'_, N>,
) -> Result<[CommandBufferObject<&'s Self>; N]>
unsafe fn allocate_command_buffer_array<'s, const N: usize>( &'s self, info: &CommandBufferFixedCountAllocateInfo<'_, N>, ) -> Result<[CommandBufferObject<&'s Self>; N]>
Sourceunsafe fn invalidate_memory_range(
&self,
ranges: &[MappedMemoryRange<'_>],
) -> Result<()>
unsafe fn invalidate_memory_range( &self, ranges: &[MappedMemoryRange<'_>], ) -> Result<()>
Invalidate MappedMemoryRanges
Invalidating the memory range allows that device writes to the memory ranges
which have been made visible to the VK_ACCESS_HOST_WRITE_BIT and VK_ACCESS_HOST_READ_BIT
are made visible to the host
§Safety
Memory object in ranges must be currently host mapped
Sourceunsafe fn flush_mapped_memory_ranges(
&self,
ranges: &[MappedMemoryRange<'_>],
) -> Result<()>
unsafe fn flush_mapped_memory_ranges( &self, ranges: &[MappedMemoryRange<'_>], ) -> Result<()>
Flush MappedMemoryRanges
Flushing the memory range allows that host writes to the memory ranges can
be made available to device access
§Safety
Memory object in ranges must be currently host mapped
Sourceunsafe fn update_descriptor_sets_raw(
&self,
writes: &[VkWriteDescriptorSet],
copies: &[VkCopyDescriptorSet],
)
unsafe fn update_descriptor_sets_raw( &self, writes: &[VkWriteDescriptorSet], copies: &[VkCopyDescriptorSet], )
Update the contents of descriptor set objects
Sourcefn update_descriptor_sets(
&self,
writes: &[DescriptorSetWriteInfo<'_>],
copies: &[DescriptorSetCopyInfo],
)
fn update_descriptor_sets( &self, writes: &[DescriptorSetWriteInfo<'_>], copies: &[DescriptorSetCopyInfo], )
Update the contents of descriptor set objects
Sourceunsafe fn wait(&self) -> Result<()>
unsafe fn wait(&self) -> Result<()>
Wait for a object to become idle
§Safety
All VkQueue objects created from this device must be externally synchronized.
Sourceunsafe fn bind_buffer_raw(
&self,
buffer: VkBuffer,
memory: VkDeviceMemory,
offset: VkDeviceSize,
) -> Result<()>
unsafe fn bind_buffer_raw( &self, buffer: VkBuffer, memory: VkDeviceMemory, offset: VkDeviceSize, ) -> Result<()>
Single binding for a buffer
§Safety
VkBuffer and VkDeviceMemory must be valid and created from this device object
Sourceunsafe fn bind_image_raw(
&self,
image: VkImage,
memory: VkDeviceMemory,
offset: VkDeviceSize,
) -> Result<()>
unsafe fn bind_image_raw( &self, image: VkImage, memory: VkDeviceMemory, offset: VkDeviceSize, ) -> Result<()>
Single binding for an image
§Safety
VkImage and VkDeviceMemory must be valid and created from this device object
Sourcefn wait_multiple_fences(
&self,
objects: &[VkHandleRef<'_, VkFence>],
wait_all: bool,
timeout: Option<u64>,
) -> Result<bool>
fn wait_multiple_fences( &self, objects: &[VkHandleRef<'_, VkFence>], wait_all: bool, timeout: Option<u64>, ) -> Result<bool>
Wait for one or more fences to become signaled, returns Ok(true) if operation is timed out
§Failures
On failure, this command returns
VK_ERROR_OUT_OF_HOST_MEMORYVK_ERROR_OUT_OF_DEVICE_MEMORYVK_ERROR_DEVICE_LOST
Sourcefn reset_multiple_fences(
&self,
objects: &[VkHandleRefMut<'_, VkFence>],
) -> Result<()>
fn reset_multiple_fences( &self, objects: &[VkHandleRefMut<'_, VkFence>], ) -> Result<()>
Resets one or more fence objects
§Failures
On failure, this command returns
VK_ERROR_OUT_OF_HOST_MEMORYVK_ERROR_OUT_OF_DEVICE_MEMORY
Sourcefn new_swapchain_raw(
&self,
info: &SwapchainCreateInfo<'_, '_, '_>,
allocation_callbacks: Option<&VkAllocationCallbacks>,
) -> Result<VkSwapchainKHR>
fn new_swapchain_raw( &self, info: &SwapchainCreateInfo<'_, '_, '_>, allocation_callbacks: Option<&VkAllocationCallbacks>, ) -> Result<VkSwapchainKHR>
Create a swapchain
§Failures
On failure, this command returns
VK_ERROR_OUT_OF_HOST_MEMORYVK_ERROR_OUT_OF_DEVICE_MEMORYVK_ERROR_DEVICE_LOSTVK_ERROR_SURFACE_LOST_KHRVK_ERROR_NATIVE_WINDOW_IN_USE_KHRVK_ERROR_INITIALIZATION_FAILED- [
VK_ERROR_COMPRESSION_EXHAUSTED_EXT]
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.