#[non_exhaustive]pub struct ResourceReport {
pub client: MemoryReport,
pub storage: StorageResourceReport,
pub transport: Option<TransportResourceReport>,
pub http: Option<HttpResourceReport>,
pub alloc: Option<AllocSnapshot>,
}Expand description
Unified per-session resource estimate: the client’s own collections plus the
components that live outside the Client and dominate real per-session
RAM — the storage backend, transport, and HTTP client — and an optional
allocation-churn snapshot.
Obtain one from Client::resource_report. Each out-of-client component
fills only what it can introspect (see the per-field types), so absent
figures mean “not reported”, not “zero”.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.client: MemoryReportThe client’s own in-process collections — identical to
Client::memory_report.
storage: StorageResourceReportStorage-backend footprint (SQLite page cache, etc.). All-None for
backends that don’t report.
transport: Option<TransportResourceReport>Transport buffers + TLS/noise state, if the transport reports them.
http: Option<HttpResourceReport>HTTP connection-pool + in-flight footprint, if the client reports it.
alloc: Option<AllocSnapshot>Allocation churn attributed to this client’s instrumented work, present
only when an AllocMeter was installed via
BotBuilder::with_alloc_meter. It is a churn/attribution signal, not a
retained figure, so it is deliberately excluded from
Self::total_estimated_bytes.
Implementations§
Source§impl ResourceReport
impl ResourceReport
Sourcepub fn total_estimated_bytes(&self) -> u64
pub fn total_estimated_bytes(&self) -> u64
Best-effort sum of retained bytes across the present point-in-time components (client collections + storage + transport + HTTP).
Exactness varies by component and this is a lower bound overall:
- client collections and transport/HTTP buffers are honest estimates;
- storage
memory_bytesis an upper bound on the SQLite page cache (min(cache cap, db size)), 0 for remote backends; - components reporting
Nonecontribute 0 (absent, not zero); alloc(churn, not residency) is excluded.
Trait Implementations§
Source§impl Clone for ResourceReport
impl Clone for ResourceReport
Source§fn clone(&self) -> ResourceReport
fn clone(&self) -> ResourceReport
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ResourceReport
impl Debug for ResourceReport
Auto Trait Implementations§
impl Freeze for ResourceReport
impl RefUnwindSafe for ResourceReport
impl Send for ResourceReport
impl Sync for ResourceReport
impl Unpin for ResourceReport
impl UnsafeUnpin for ResourceReport
impl UnwindSafe for ResourceReport
Blanket Implementations§
Source§impl<T> AggregateExpressionMethods for T
impl<T> AggregateExpressionMethods for T
Source§fn aggregate_distinct(self) -> Self::Outputwhere
Self: DistinctDsl,
fn aggregate_distinct(self) -> Self::Outputwhere
Self: DistinctDsl,
DISTINCT modifier for aggregate functions Read moreSource§fn aggregate_all(self) -> Self::Outputwhere
Self: AllDsl,
fn aggregate_all(self) -> Self::Outputwhere
Self: AllDsl,
ALL modifier for aggregate functions Read moreSource§fn aggregate_filter<P>(self, f: P) -> Self::Output
fn aggregate_filter<P>(self, f: P) -> Self::Output
Source§fn aggregate_order<O>(self, o: O) -> Self::Outputwhere
Self: OrderAggregateDsl<O>,
fn aggregate_order<O>(self, o: O) -> Self::Outputwhere
Self: OrderAggregateDsl<O>,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoSql for T
impl<T> IntoSql for T
Source§fn into_sql<T>(self) -> Self::Expression
fn into_sql<T>(self) -> Self::Expression
self to an expression for Diesel’s query builder. Read moreSource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
&self to an expression for Diesel’s query builder. Read moreimpl<T> MaybeSend for T
impl<T> MaybeSendSync for T
impl<T> Spawnable for Twhere
T: Send + 'static,
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read more