Struct Scope
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§
§impl Scope
impl Scope
pub 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.
pub fn set_fingerprint(&mut self, fingerprint: Option<&[&str]>)
pub fn set_fingerprint(&mut self, fingerprint: Option<&[&str]>)
Sets the fingerprint.
pub fn set_transaction(&mut self, transaction: Option<&str>)
pub fn set_transaction(&mut self, transaction: Option<&str>)
Sets the transaction.
pub 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.
pub fn set_context<C>(&mut self, key: &str, value: C)
pub fn set_context<C>(&mut self, key: &str, value: C)
Sets a context for a key.
pub fn remove_context(&mut self, key: &str)
pub fn remove_context(&mut self, key: &str)
Removes a context for a key.
pub fn remove_extra(&mut self, key: &str)
pub fn remove_extra(&mut self, key: &str)
Removes a extra.
pub 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.
pub fn add_attachment(&mut self, attachment: Attachment)
pub fn add_attachment(&mut self, attachment: Attachment)
Adds an attachment to the scope
pub fn clear_attachments(&mut self)
pub fn clear_attachments(&mut self)
Clears attachments from the scope
pub 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.
pub 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.
pub 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.
pub fn get_span(&self) -> Option<TransactionOrSpan>
pub fn get_span(&self) -> Option<TransactionOrSpan>
Returns the currently active span.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Scope
impl !RefUnwindSafe for Scope
impl Send for Scope
impl Sync for Scope
impl Unpin for Scope
impl !UnwindSafe for Scope
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)