[][src]Struct sentry_core::Scope

pub struct Scope { /* fields omitted */ }

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:

  1. the scope is routinely updated with information by functions such as add_breadcrumb which will modify the currently top-most scope.
  2. 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.


impl Scope[src]

pub fn clear(&mut self)[src]

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.

pub fn clear_breadcrumbs(&mut self)[src]

Deletes current breadcrumbs from the scope.

pub fn set_level(&mut self, level: Option<Level>)[src]

Sets a level override.

pub fn set_fingerprint(&mut self, fingerprint: Option<&[&str]>)[src]

Sets the fingerprint.

pub fn set_transaction(&mut self, transaction: Option<&str>)[src]

Sets the transaction.

pub fn set_user(&mut self, user: Option<User>)[src]

Sets the user for the current scope.

pub fn set_tag<V: ToString>(&mut self, key: &str, value: V)[src]

Sets a tag to a specific value.

pub fn remove_tag(&mut self, key: &str)[src]

Removes a tag.

If the tag is not set, does nothing.

pub fn set_context<C: Into<Context>>(&mut self, key: &str, value: C)[src]

Sets a context for a key.

pub fn remove_context(&mut self, key: &str)[src]

Removes a context for a key.

pub fn set_extra(&mut self, key: &str, value: Value)[src]

Sets a extra to a specific value.

pub fn remove_extra(&mut self, key: &str)[src]

Removes a extra.

pub fn add_event_processor(
    &mut self,
    f: Box<dyn Fn(Event<'static>) -> Option<Event<'static>> + Send + Sync>

Add an event processor to the scope.

pub fn apply_to_event(
    mut event: Event<'static>
) -> Option<Event<'static>>

Applies the contained scoped data to fill an event.

Trait Implementations

impl Clone for Scope[src]

impl Debug for Scope[src]

impl Default for Scope[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T> ToOwned for T where
    T: Clone

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,