pub struct OptimizedRecord {
pub allocation: PartialAllocationInfo,
pub preformatted_fields: HashMap<AllocationField, String>,
pub created_at: Instant,
pub memory_usage: usize,
}Expand description
Optimized record structure with pre-formatted fields
Fields§
§allocation: PartialAllocationInfoOriginal allocation info
preformatted_fields: HashMap<AllocationField, String>Pre-formatted field values for common fields
created_at: InstantTimestamp when this record was created
memory_usage: usizeEstimated memory usage of this record
Implementations§
Source§impl OptimizedRecord
impl OptimizedRecord
Sourcepub fn new(allocation: PartialAllocationInfo) -> Self
pub fn new(allocation: PartialAllocationInfo) -> Self
Create a new optimized record
Sourcepub fn preformat_fields(&mut self, fields: &HashSet<AllocationField>)
pub fn preformat_fields(&mut self, fields: &HashSet<AllocationField>)
Pre-format commonly used fields
Sourcepub fn get_formatted_field(&self, field: &AllocationField) -> Option<String>
pub fn get_formatted_field(&self, field: &AllocationField) -> Option<String>
Get a formatted field value (from cache or format on demand)
Trait Implementations§
Source§impl Clone for OptimizedRecord
impl Clone for OptimizedRecord
Source§fn clone(&self) -> OptimizedRecord
fn clone(&self) -> OptimizedRecord
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for OptimizedRecord
impl RefUnwindSafe for OptimizedRecord
impl Send for OptimizedRecord
impl Sync for OptimizedRecord
impl Unpin for OptimizedRecord
impl UnwindSafe for OptimizedRecord
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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 more