Struct puffin::ScopeCollection
source · pub struct ScopeCollection(/* private fields */);
Expand description
A collection of scope details containing more information about a recorded profile scope.
Implementations§
source§impl ScopeCollection
impl ScopeCollection
sourcepub fn fetch_by_id(&self, scope_id: &ScopeId) -> Option<&Arc<ScopeDetails>>
pub fn fetch_by_id(&self, scope_id: &ScopeId) -> Option<&Arc<ScopeDetails>>
Fetches scope details by scope id.
sourcepub fn fetch_by_name(&self, scope_name: &str) -> Option<&ScopeId>
pub fn fetch_by_name(&self, scope_name: &str) -> Option<&ScopeId>
Fetches scope details by scope name.
sourcepub fn insert(&mut self, scope_details: Arc<ScopeDetails>) -> Arc<ScopeDetails>
pub fn insert(&mut self, scope_details: Arc<ScopeDetails>) -> Arc<ScopeDetails>
Insert a scope into the collection. This method asserts the scope id is set which only puffin should do. Custom sinks might use this method to store new scope details received from puffin.
sourcepub fn scopes_by_name(&self) -> &HashMap<Cow<'static, str>, ScopeId>
pub fn scopes_by_name(&self) -> &HashMap<Cow<'static, str>, ScopeId>
Fetches all registered scopes and their ids. Useful for fetching scope id by it’s scope name. For profiler scopes and user scopes this is the manual provided name. For function profiler scopes this is the function name.
sourcepub fn scopes_by_id(&self) -> &HashMap<ScopeId, Arc<ScopeDetails>>
pub fn scopes_by_id(&self) -> &HashMap<ScopeId, Arc<ScopeDetails>>
Fetches all registered scopes. Useful for fetching scope details by a scope id.
Trait Implementations§
source§impl Clone for ScopeCollection
impl Clone for ScopeCollection
source§fn clone(&self) -> ScopeCollection
fn clone(&self) -> ScopeCollection
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 Default for ScopeCollection
impl Default for ScopeCollection
source§fn default() -> ScopeCollection
fn default() -> ScopeCollection
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ScopeCollection
impl RefUnwindSafe for ScopeCollection
impl Send for ScopeCollection
impl Sync for ScopeCollection
impl Unpin for ScopeCollection
impl UnwindSafe for ScopeCollection
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