pub struct Scope { /* private fields */ }
Expand description
Holds contextual data for the current scope.
The scope is an object that can be cloned efficiently and stores data that is locally relevant to an event. For instance the scope will hold recorded breadcrumbs and similar information.
The scope can be interacted with in two ways:
- the scope is routinely updated with information by functions such as
add_breadcrumb
which will modify the currently top-most scope. - the topmost scope can also be configured through the
configure_scope
method.
Note that the scope can only be modified but not inspected. Only the client can use the scope to extract information currently.
Implementations§
Source§impl Scope
impl Scope
Sourcepub fn clear(&mut self)
pub fn clear(&mut self)
Clear the scope.
By default a scope will inherit all values from the higher scope. In some situations this might not be what a user wants. Calling this method will wipe all data contained within.
Deletes current breadcrumbs from the scope.
Sourcepub fn set_fingerprint(&mut self, fingerprint: Option<&[&str]>)
pub fn set_fingerprint(&mut self, fingerprint: Option<&[&str]>)
Sets the fingerprint.
Sourcepub fn set_transaction(&mut self, transaction: Option<&str>)
pub fn set_transaction(&mut self, transaction: Option<&str>)
Sets the transaction.
Sourcepub fn remove_tag(&mut self, key: &str)
pub fn remove_tag(&mut self, key: &str)
Removes a tag.
If the tag is not set, does nothing.
Sourcepub fn set_context<C: Into<Context>>(&mut self, key: &str, value: C)
pub fn set_context<C: Into<Context>>(&mut self, key: &str, value: C)
Sets a context for a key.
Sourcepub fn remove_context(&mut self, key: &str)
pub fn remove_context(&mut self, key: &str)
Removes a context for a key.
Sourcepub fn remove_extra(&mut self, key: &str)
pub fn remove_extra(&mut self, key: &str)
Removes a extra.
Sourcepub fn add_event_processor<F>(&mut self, f: F)
pub fn add_event_processor<F>(&mut self, f: F)
Add an event processor to the scope.
Sourcepub fn add_attachment(&mut self, attachment: Attachment)
pub fn add_attachment(&mut self, attachment: Attachment)
Adds an attachment to the scope
Sourcepub fn clear_attachments(&mut self)
pub fn clear_attachments(&mut self)
Clears attachments from the scope
Sourcepub fn apply_to_event(&self, event: Event<'static>) -> Option<Event<'static>>
pub fn apply_to_event(&self, event: Event<'static>) -> Option<Event<'static>>
Applies the contained scoped data to fill an event.
Sourcepub fn apply_to_transaction(&self, transaction: &mut Transaction<'static>)
pub fn apply_to_transaction(&self, transaction: &mut Transaction<'static>)
Applies the contained scoped data to fill a transaction.
Sourcepub fn set_span(&mut self, span: Option<TransactionOrSpan>)
pub fn set_span(&mut self, span: Option<TransactionOrSpan>)
Set the given TransactionOrSpan
as the active span for this scope.
Sourcepub fn get_span(&self) -> Option<TransactionOrSpan>
pub fn get_span(&self) -> Option<TransactionOrSpan>
Returns the currently active span.