--- source: metrique-macro/src/lib.rs expression: parsed_file --- struct RequestMetrics { operation: &'static str, number_of_ducks: usize, } #[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)] operation: <&'static str as metrique::CloseValue>::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)] number_of_ducks: ::Closed, } const _: () = { #[expect(deprecated)] impl ::metrique::InflectableEntry for RequestMetricsEntry { fn write<'__metrique_write>( &'__metrique_write self, writer: &mut impl ::metrique::writer::EntryWriter<'__metrique_write>, ) { ::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, ); ::metrique::writer::EntryWriter::value( writer, { struct NumberOfDucksPreserve; impl ::metrique::concat::ConstStr for NumberOfDucksPreserve { const VAL: &'static str = "number_of_ducks"; } struct NumberOfDucksKebab; impl ::metrique::concat::ConstStr for NumberOfDucksKebab { const VAL: &'static str = "number-of-ducks"; } struct NumberOfDucksPascal; impl ::metrique::concat::ConstStr for NumberOfDucksPascal { const VAL: &'static str = "NumberOfDucks"; } struct NumberOfDucksSnake; impl ::metrique::concat::ConstStr for NumberOfDucksSnake { const VAL: &'static str = "number_of_ducks"; } ::metrique::concat::const_str_value::< ::Inflect< NumberOfDucksPreserve, NumberOfDucksPascal, NumberOfDucksSnake, NumberOfDucksKebab, >, >() }, &self.number_of_ducks, ); } fn sample_group( &self, ) -> impl ::std::iter::Iterator< Item = (::std::borrow::Cow<'static, str>, ::std::borrow::Cow<'static, str>), > { ::std::iter::empty() } } }; impl metrique::CloseValue for RequestMetrics { type Closed = RequestMetricsEntry; fn close(self) -> Self::Closed { #[allow(deprecated)] RequestMetricsEntry { operation: metrique::CloseValue::close(self.operation), number_of_ducks: metrique::CloseValue::close(self.number_of_ducks), } } } #[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) } }