Struct alloc_data::Alloc
source · [−]pub struct Alloc {
pub uid: Alloc,
pub kind: AllocKind,
pub size: u32,
pub real_size: u32,
pub nsamples: u32,
pub toc: SinceStart,
pub tod: Option<SinceStart>,
/* private fields */
}
Expand description
Some allocation information.
Fields
uid: Alloc
Uid of the allocation.
kind: AllocKind
Allocation kind.
size: u32
Size of the allocation.
real_size: u32
Real size of the allocation.
nsamples: u32
Sample count.
toc: SinceStart
Time of creation.
tod: Option<SinceStart>
Time of death.
Implementations
sourceimpl Alloc
impl Alloc
sourcepub fn new(
sample_rate: &SampleRate,
uid: impl Into<Alloc>,
kind: AllocKind,
size: u32,
trace: Trace,
labels: Labels,
toc: SinceStart,
tod: Option<SinceStart>
) -> Self
pub fn new(
sample_rate: &SampleRate,
uid: impl Into<Alloc>,
kind: AllocKind,
size: u32,
trace: Trace,
labels: Labels,
toc: SinceStart,
tod: Option<SinceStart>
) -> Self
Constructor.
sourcepub fn set_tod(&mut self, tod: SinceStart) -> Result<(), String>
pub fn set_tod(&mut self, tod: SinceStart) -> Result<(), String>
Sets the time of death.
Bails if a time of death is already registered.
sourcepub fn set_toc(&mut self, toc: SinceStart)
pub fn set_toc(&mut self, toc: SinceStart)
Sets the time of creation.
sourcepub fn alloc_site_do<Res>(
&self,
action: impl FnOnce(Option<&CLoc>) -> Res
) -> Res
pub fn alloc_site_do<Res>(
&self,
action: impl FnOnce(Option<&CLoc>) -> Res
) -> Res
Allocation-site of the allocation.
sourcepub fn toc(&self) -> SinceStart
pub fn toc(&self) -> SinceStart
Time of creation accessor.
sourcepub fn tod(&self) -> Option<SinceStart>
pub fn tod(&self) -> Option<SinceStart>
Time of death accessor.
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Alloc
impl<'de> Deserialize<'de> for Alloc
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Alloc
impl StructuralEq for Alloc
impl StructuralPartialEq for Alloc
Auto Trait Implementations
impl RefUnwindSafe for Alloc
impl Send for Alloc
impl Sync for Alloc
impl Unpin for Alloc
impl UnwindSafe for Alloc
Blanket Implementations
impl<Src, Scheme> ApproxFrom<Src, Scheme> for Src where
Scheme: ApproxScheme,
impl<Src, Scheme> ApproxFrom<Src, Scheme> for Src where
Scheme: ApproxScheme,
type Err = NoError
type Err = NoError
The error type produced by a failed conversion.
fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
Convert the given value into an approximately equivalent representation.
impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Src where
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Src where
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
The error type produced by a failed conversion.
fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
Convert the subject into an approximately equivalent representation.
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> ConvUtil for T
impl<T> ConvUtil for T
fn approx_as<Dst>(self) -> Result<Dst, Self::Err> where
Self: ApproxInto<Dst, DefaultApprox>,
fn approx_as<Dst>(self) -> Result<Dst, Self::Err> where
Self: ApproxInto<Dst, DefaultApprox>,
Approximate the subject to a given type with the default scheme.
fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err> where
Self: ApproxInto<Dst, Scheme>,
Scheme: ApproxScheme,
fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err> where
Self: ApproxInto<Dst, Scheme>,
Scheme: ApproxScheme,
Approximate the subject to a given type with a specific scheme.
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
impl<Src> ValueFrom<Src> for Src
impl<Src> ValueFrom<Src> for Src
type Err = NoError
type Err = NoError
The error type produced by a failed conversion.
fn value_from(src: Src) -> Result<Src, <Src as ValueFrom<Src>>::Err>
fn value_from(src: Src) -> Result<Src, <Src as ValueFrom<Src>>::Err>
Convert the given value into an exactly equivalent representation.
impl<Src, Dst> ValueInto<Dst> for Src where
Dst: ValueFrom<Src>,
impl<Src, Dst> ValueInto<Dst> for Src where
Dst: ValueFrom<Src>,
type Err = <Dst as ValueFrom<Src>>::Err
type Err = <Dst as ValueFrom<Src>>::Err
The error type produced by a failed conversion.
fn value_into(self) -> Result<Dst, <Src as ValueInto<Dst>>::Err>
fn value_into(self) -> Result<Dst, <Src as ValueInto<Dst>>::Err>
Convert the subject into an exactly equivalent representation.