pub struct MaterialProperties {Show 17 fields
pub render_method: OpaqueRendererMethod,
pub alpha_mode: AlphaMode,
pub mesh_pipeline_key_bits: ErasedMeshPipelineKey,
pub depth_bias: f32,
pub reads_view_transmission_texture: bool,
pub render_phase_type: RenderPhaseType,
pub material_layout: Option<BindGroupLayoutDescriptor>,
pub draw_functions: SmallVec<[(Interned<dyn DrawFunctionLabel>, DrawFunctionId); 11]>,
pub shaders: SmallVec<[(Interned<dyn ShaderLabel>, Handle<Shader>); 6]>,
pub bindless: bool,
pub base_specialize: Option<fn(&mut World, ErasedMaterialPipelineKey, &MeshVertexBufferLayoutRef, &Arc<MaterialProperties>) -> Result<CachedRenderPipelineId, SpecializedMeshPipelineError>>,
pub prepass_specialize: Option<fn(&mut World, &ErasedMaterialPipelineKey, &MeshVertexBufferLayoutRef, &Arc<MaterialProperties>) -> Result<CachedRenderPipelineId, SpecializedMeshPipelineError>>,
pub user_specialize: Option<fn(&(dyn Any + 'static), &mut RenderPipelineDescriptor, &MeshVertexBufferLayoutRef, ErasedMaterialPipelineKey) -> Result<(), SpecializedMeshPipelineError>>,
pub material_key: ErasedMaterialKey,
pub shadows_enabled: bool,
pub prepass_enabled: bool,
pub oit_enabled: bool,
}bevy_material only.Expand description
Common material properties, calculated for a specific material instance.
Fields§
§render_method: OpaqueRendererMethodIs this material should be rendered by the deferred renderer when.
AlphaMode::Opaque or AlphaMode::Mask
alpha_mode: AlphaModeThe AlphaMode of this material.
mesh_pipeline_key_bits: ErasedMeshPipelineKeyThe bits in the ErasedMeshPipelineKey for this material.
These are precalculated so that we can just “or” them together in
queue_material_meshes.
depth_bias: f32Add a bias to the view depth of the mesh which can be used to force a specific render order for meshes with equal depth, to avoid z-fighting. The bias is in depth-texture units so large values may be needed to overcome small depth differences.
reads_view_transmission_texture: boolWhether the material would like to read from
ViewTransmissionTexture.
This allows taking color output from the Opaque3d
pass as an input, (for screen-space transmission) but requires rendering to take place in a separate
Transmissive3d pass.
render_phase_type: RenderPhaseType§material_layout: Option<BindGroupLayoutDescriptor>§draw_functions: SmallVec<[(Interned<dyn DrawFunctionLabel>, DrawFunctionId); 11]>Backing array is a size of 11 because the StandardMaterial
needs 11 draw functions by default
shaders: SmallVec<[(Interned<dyn ShaderLabel>, Handle<Shader>); 6]>Backing array is a size of 6 because the StandardMaterial
has 6 custom shaders (frag, prepass_frag, deferred_frag, vertex, prepass_vertex,
deferred vertex) which is the most common use case
bindless: boolWhether this material actually uses bindless resources, taking the platform support (or lack thereof) of bindless resources into account.
base_specialize: Option<fn(&mut World, ErasedMaterialPipelineKey, &MeshVertexBufferLayoutRef, &Arc<MaterialProperties>) -> Result<CachedRenderPipelineId, SpecializedMeshPipelineError>>§prepass_specialize: Option<fn(&mut World, &ErasedMaterialPipelineKey, &MeshVertexBufferLayoutRef, &Arc<MaterialProperties>) -> Result<CachedRenderPipelineId, SpecializedMeshPipelineError>>§user_specialize: Option<fn(&(dyn Any + 'static), &mut RenderPipelineDescriptor, &MeshVertexBufferLayoutRef, ErasedMaterialPipelineKey) -> Result<(), SpecializedMeshPipelineError>>§material_key: ErasedMaterialKeyThe key for this material, typically a bitfield of flags that are used to modify the pipeline descriptor used for this material.
shadows_enabled: boolWhether shadows are enabled for this material
prepass_enabled: boolWhether prepass is enabled for this material
oit_enabled: boolWhether OIT is enabled for this material
Implementations§
Source§impl MaterialProperties
impl MaterialProperties
pub fn get_shader(&self, label: impl ShaderLabel) -> Option<Handle<Shader>>
Sourcepub fn add_shader(&mut self, label: impl ShaderLabel, shader: Handle<Shader>)
pub fn add_shader(&mut self, label: impl ShaderLabel, shader: Handle<Shader>)
Examples found in repository?
147 fn prepare_asset(
148 source_asset: Self::SourceAsset,
149 asset_id: AssetId<Self::SourceAsset>,
150 (
151 opaque_draw_functions,
152 material_layout,
153 asset_server,
154 bind_group_allocators,
155 render_material_bindings,
156 gpu_images,
157 image_material_sampler,
158 ): &mut SystemParamItem<Self::Param>,
159 ) -> std::result::Result<Self::ErasedAsset, PrepareAssetError<Self::SourceAsset>> {
160 let material_layout = material_layout.0.clone();
161 let draw_function_id = opaque_draw_functions.read().id::<DrawMaterial>();
162 let bind_group_allocator = bind_group_allocators
163 .get_mut(&TypeId::of::<ImageMaterial>())
164 .unwrap();
165 let Some(image) = gpu_images.get(&source_asset.image) else {
166 return Err(PrepareAssetError::RetryNextUpdate(source_asset));
167 };
168 let mut unprepared = BindGroupBuilder {
169 binding_resources: UnpreparedBindingResources(vec![
170 (
171 0,
172 UnpreparedBindingResource::TextureView(
173 TextureViewDimension::D2,
174 image.texture_view.clone(),
175 ),
176 ),
177 (
178 1,
179 UnpreparedBindingResource::Sampler(
180 SamplerBindingType::NonFiltering,
181 image_material_sampler.0.clone(),
182 ),
183 ),
184 ]),
185 data_buffer: vec![],
186 };
187 let binding = match render_material_bindings.entry(asset_id.into()) {
188 Entry::Occupied(mut occupied_entry) => {
189 bind_group_allocator.free(*occupied_entry.get());
190 let new_binding =
191 bind_group_allocator.allocate_unprepared(&mut unprepared, &material_layout);
192 *occupied_entry.get_mut() = new_binding;
193 new_binding
194 }
195 Entry::Vacant(vacant_entry) => *vacant_entry.insert(
196 bind_group_allocator.allocate_unprepared(&mut unprepared, &material_layout),
197 ),
198 };
199
200 let mut properties = MaterialProperties {
201 material_layout: Some(material_layout),
202 mesh_pipeline_key_bits: ErasedMeshPipelineKey::new(MeshPipelineKey::empty()),
203 base_specialize: Some(base_specialize),
204 ..Default::default()
205 };
206 properties.add_draw_function(MainPassOpaqueDrawFunction, draw_function_id);
207 properties.add_shader(MaterialFragmentShader, asset_server.load(SHADER_ASSET_PATH));
208
209 Ok(PreparedMaterial {
210 binding,
211 properties: Arc::new(properties),
212 })
213 }pub fn get_draw_function( &self, label: impl DrawFunctionLabel, ) -> Option<DrawFunctionId>
Sourcepub fn add_draw_function(
&mut self,
label: impl DrawFunctionLabel,
draw_function: DrawFunctionId,
)
pub fn add_draw_function( &mut self, label: impl DrawFunctionLabel, draw_function: DrawFunctionId, )
Examples found in repository?
147 fn prepare_asset(
148 source_asset: Self::SourceAsset,
149 asset_id: AssetId<Self::SourceAsset>,
150 (
151 opaque_draw_functions,
152 material_layout,
153 asset_server,
154 bind_group_allocators,
155 render_material_bindings,
156 gpu_images,
157 image_material_sampler,
158 ): &mut SystemParamItem<Self::Param>,
159 ) -> std::result::Result<Self::ErasedAsset, PrepareAssetError<Self::SourceAsset>> {
160 let material_layout = material_layout.0.clone();
161 let draw_function_id = opaque_draw_functions.read().id::<DrawMaterial>();
162 let bind_group_allocator = bind_group_allocators
163 .get_mut(&TypeId::of::<ImageMaterial>())
164 .unwrap();
165 let Some(image) = gpu_images.get(&source_asset.image) else {
166 return Err(PrepareAssetError::RetryNextUpdate(source_asset));
167 };
168 let mut unprepared = BindGroupBuilder {
169 binding_resources: UnpreparedBindingResources(vec![
170 (
171 0,
172 UnpreparedBindingResource::TextureView(
173 TextureViewDimension::D2,
174 image.texture_view.clone(),
175 ),
176 ),
177 (
178 1,
179 UnpreparedBindingResource::Sampler(
180 SamplerBindingType::NonFiltering,
181 image_material_sampler.0.clone(),
182 ),
183 ),
184 ]),
185 data_buffer: vec![],
186 };
187 let binding = match render_material_bindings.entry(asset_id.into()) {
188 Entry::Occupied(mut occupied_entry) => {
189 bind_group_allocator.free(*occupied_entry.get());
190 let new_binding =
191 bind_group_allocator.allocate_unprepared(&mut unprepared, &material_layout);
192 *occupied_entry.get_mut() = new_binding;
193 new_binding
194 }
195 Entry::Vacant(vacant_entry) => *vacant_entry.insert(
196 bind_group_allocator.allocate_unprepared(&mut unprepared, &material_layout),
197 ),
198 };
199
200 let mut properties = MaterialProperties {
201 material_layout: Some(material_layout),
202 mesh_pipeline_key_bits: ErasedMeshPipelineKey::new(MeshPipelineKey::empty()),
203 base_specialize: Some(base_specialize),
204 ..Default::default()
205 };
206 properties.add_draw_function(MainPassOpaqueDrawFunction, draw_function_id);
207 properties.add_shader(MaterialFragmentShader, asset_server.load(SHADER_ASSET_PATH));
208
209 Ok(PreparedMaterial {
210 binding,
211 properties: Arc::new(properties),
212 })
213 }Trait Implementations§
Source§impl Default for MaterialProperties
impl Default for MaterialProperties
Source§fn default() -> MaterialProperties
fn default() -> MaterialProperties
Auto Trait Implementations§
impl !RefUnwindSafe for MaterialProperties
impl !Unpin for MaterialProperties
impl !UnwindSafe for MaterialProperties
impl Freeze for MaterialProperties
impl Send for MaterialProperties
impl Sync for MaterialProperties
impl UnsafeUnpin for MaterialProperties
Blanket Implementations§
Source§impl<T, U> AsBindGroupShaderType<U> for T
impl<T, U> AsBindGroupShaderType<U> for T
Source§fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
T ShaderType for self. When used in AsBindGroup
derives, it is safe to assume that all images in self exist.Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ConditionalSend for Twhere
T: Send,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
Source§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates Self using default().
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<T> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
Source§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
Source§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
Source§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().impl<T> Settings for T
Source§impl<Ret> SpawnIfAsync<(), Ret> for Ret
impl<Ret> SpawnIfAsync<(), Ret> for Ret
Source§impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
Source§fn super_from(input: T) -> O
fn super_from(input: T) -> O
Source§impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
Source§fn super_into(self) -> O
fn super_into(self) -> O
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.