[−][src]Struct sentry_core::Scope
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
[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>
)
[src]
&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(
&self,
mut event: Event<'static>
) -> Option<Event<'static>>
[src]
&self,
mut event: Event<'static>
) -> Option<Event<'static>>
Applies the contained scoped data to fill an event.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Scope
[src]
impl Send for Scope
[src]
impl Sync for Scope
[src]
impl Unpin for Scope
[src]
impl !UnwindSafe for Scope
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,