Struct puffin::ScopeDetails
source · pub struct ScopeDetails {
pub scope_name: Option<Cow<'static, str>>,
pub function_name: Cow<'static, str>,
pub file_path: Cow<'static, str>,
pub line_nr: u32,
/* private fields */
}Expand description
Detailed information about a scope.
Fields§
§scope_name: Option<Cow<'static, str>>A name for a profile scope, a function profile scope does not have a custom provided name.
function_name: Cow<'static, str>The function name of the function in which this scope is contained. The name might be slightly modified to represent a short descriptive representation.
file_path: Cow<'static, str>The file path in which this scope is contained. The path might be slightly modified to represent a short descriptive representation.
line_nr: u32The exact line number at which this scope is located.
Implementations§
source§impl ScopeDetails
impl ScopeDetails
sourcepub fn from_scope_name<T>(scope_name: T) -> Self
pub fn from_scope_name<T>(scope_name: T) -> Self
Creates a new user scope with a unique name.
sourcepub fn with_function_name<T>(self, name: T) -> Self
pub fn with_function_name<T>(self, name: T) -> Self
Scope in a function.
sourcepub fn with_line_nr(self, line_nr: u32) -> Self
pub fn with_line_nr(self, line_nr: u32) -> Self
Scope at a line number.
sourcepub fn name(&self) -> &Cow<'static, str>
pub fn name(&self) -> &Cow<'static, str>
Returns the scope name if this is a profile scope or else the function name.
sourcepub fn scope_type(&self) -> ScopeType
pub fn scope_type(&self) -> ScopeType
Returns what type of scope this is.
Trait Implementations§
source§impl Clone for ScopeDetails
impl Clone for ScopeDetails
source§fn clone(&self) -> ScopeDetails
fn clone(&self) -> ScopeDetails
Returns a copy 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 moresource§impl Debug for ScopeDetails
impl Debug for ScopeDetails
source§impl Default for ScopeDetails
impl Default for ScopeDetails
source§fn default() -> ScopeDetails
fn default() -> ScopeDetails
Returns the “default value” for a type. Read more
source§impl Hash for ScopeDetails
impl Hash for ScopeDetails
source§impl Ord for ScopeDetails
impl Ord for ScopeDetails
source§fn cmp(&self, other: &ScopeDetails) -> Ordering
fn cmp(&self, other: &ScopeDetails) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq for ScopeDetails
impl PartialEq for ScopeDetails
source§fn eq(&self, other: &ScopeDetails) -> bool
fn eq(&self, other: &ScopeDetails) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl PartialOrd for ScopeDetails
impl PartialOrd for ScopeDetails
source§fn partial_cmp(&self, other: &ScopeDetails) -> Option<Ordering>
fn partial_cmp(&self, other: &ScopeDetails) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moreimpl Eq for ScopeDetails
impl StructuralPartialEq for ScopeDetails
Auto Trait Implementations§
impl Freeze for ScopeDetails
impl RefUnwindSafe for ScopeDetails
impl Send for ScopeDetails
impl Sync for ScopeDetails
impl Unpin for ScopeDetails
impl UnwindSafe for ScopeDetails
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