#[cfg(feature = "test-counters")]
pub(crate) use crate::testing::{
Fallible, Growing, LoadId, Origin, SpanRow, allocator, budget, limit, span_read,
};
#[cfg(not(feature = "test-counters"))]
pub(crate) use off::{
Fallible, Growing, LoadId, Origin, SpanRow, allocator, budget, limit, span_read,
};
#[cfg(not(feature = "test-counters"))]
#[allow(clippy::unused_self, clippy::needless_pass_by_value)]
mod off {
use std::mem::size_of;
use crate::budget::Reservation;
use crate::error::LimitKind;
use crate::raw::RawStr;
#[inline]
pub(crate) fn limit(_: LimitKind) {}
#[inline]
pub(crate) fn budget(_: Reservation) {}
#[inline]
pub(crate) fn allocator(_: Reservation) {}
pub(crate) struct Fallible;
impl Fallible {
#[inline]
pub(crate) fn enter() -> Self {
Self
}
}
pub(crate) struct Growing;
impl Growing {
#[inline]
pub(crate) fn enter() -> Self {
Self
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub(crate) struct LoadId;
impl LoadId {
pub(crate) const BARE: Self = Self;
#[inline]
pub(crate) fn draw(_: &RawStr) -> Self {
Self
}
}
#[derive(Debug)]
pub(crate) struct Origin;
impl Origin {
#[inline]
pub(crate) fn opened() -> Self {
Self
}
}
#[derive(Clone, Copy, Debug)]
pub(crate) struct SpanRow;
impl SpanRow {
pub(crate) const WHOLE: Self = Self;
#[inline]
pub(crate) const fn row(_: usize) -> Self {
Self
}
}
#[inline]
pub(crate) fn span_read(_: &Origin, _: SpanRow) {}
const _: () = assert!(
size_of::<Fallible>() == 0
&& size_of::<Growing>() == 0
&& size_of::<LoadId>() == 0
&& size_of::<Origin>() == 0
&& size_of::<SpanRow>() == 0
);
}
#[cfg(test)]
#[path = "counters_scan_tests.rs"]
mod scan_tests;