From 974b83730e0e554d821a025f9d4945061f9d295e Mon Sep 17 00:00:00 2001 From: Kevin Reid Date: Fri, 1 Apr 2022 20:17:02 -0700 Subject: [PATCH] impl Debug for StagingBelt --- wgpu/src/util/belt.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/wgpu/src/util/belt.rs b/wgpu/src/util/belt.rs index 0145fb36bb..d735d18474 100644 --- a/wgpu/src/util/belt.rs +++ b/wgpu/src/util/belt.rs @@ -2,6 +2,7 @@ use crate::{ Buffer, BufferAddress, BufferDescriptor, BufferSize, BufferUsages, BufferViewMut, CommandEncoder, Device, MapMode, }; +use std::fmt; use std::pin::Pin; use std::task::{self, Poll}; use std::{future::Future, sync::mpsc}; @@ -182,3 +183,14 @@ impl StagingBelt { Join { futures } } } + +impl fmt::Debug for StagingBelt { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct("StagingBelt") + .field("chunk_size", &self.chunk_size) + .field("active_chunks", &self.active_chunks.len()) + .field("closed_chunks", &self.closed_chunks.len()) + .field("free_chunks", &self.free_chunks.len()) + .finish_non_exhaustive() + } +}