pub struct Frame { /* private fields */ }Expand description
A single context or attachment inside of a Report.
Frames are organized as a singly linked list, which can be iterated by calling
Report::frames(). The head contains the current context or attachment, and the tail contains
the root context created by Report::new(). The next Frame can be accessed by requesting it
by calling Report::request_ref().
Implementations§
Source§impl Frame
impl Frame
Sourcepub const fn sources(&self) -> &[Self]
pub const fn sources(&self) -> &[Self]
Returns a shared reference to the source of this Frame.
This corresponds to the Frame below this one in a Report.
Sourcepub fn sources_mut(&mut self) -> &mut [Self]
pub fn sources_mut(&mut self) -> &mut [Self]
Returns a mutable reference to the sources of this Frame.
This corresponds to the Frame below this one in a Report.
Sourcepub fn request_ref<T>(&self) -> Option<&T>where
T: ?Sized + 'static,
Available on nightly only.
pub fn request_ref<T>(&self) -> Option<&T>where
T: ?Sized + 'static,
nightly only.Requests the reference to T from the Frame if provided.
Sourcepub fn request_value<T>(&self) -> Option<T>where
T: 'static,
Available on nightly only.
pub fn request_value<T>(&self) -> Option<T>where
T: 'static,
nightly only.Requests the value of T from the Frame if provided.
Sourcepub fn is<T: Send + Sync + 'static>(&self) -> bool
pub fn is<T: Send + Sync + 'static>(&self) -> bool
Returns if T is the held context or attachment by this frame.
Sourcepub fn downcast_ref<T: Send + Sync + 'static>(&self) -> Option<&T>
pub fn downcast_ref<T: Send + Sync + 'static>(&self) -> Option<&T>
Downcasts this frame if the held context or attachment is the same as T.