pub struct SpanRecoveryFrame<T> { /* private fields */ }Expand description
A single span-recovery frame and whether it still comes from macro expansion.
Implementations§
Source§impl<T> SpanRecoveryFrame<T>
impl<T> SpanRecoveryFrame<T>
Sourcepub const fn new(value: T, from_expansion: bool) -> Self
pub const fn new(value: T, from_expansion: bool) -> Self
Builds a recovery frame from a value and expansion flag.
§Examples
use whitaker_common::rstest::SpanRecoveryFrame;
use whitaker_common::span::{SourceLocation, SourceSpan};
let span = SourceSpan::new(SourceLocation::new(3, 1), SourceLocation::new(3, 8))
.expect("example span should be valid");
let frame = SpanRecoveryFrame::new(span, true);
assert!(frame.from_expansion());Sourcepub fn into_value(self) -> T
pub fn into_value(self) -> T
Consumes the frame and returns the stored value.
Sourcepub const fn from_expansion(&self) -> bool
pub const fn from_expansion(&self) -> bool
Returns whether the frame still originates from macro expansion.
Trait Implementations§
Source§impl<T: Clone> Clone for SpanRecoveryFrame<T>
impl<T: Clone> Clone for SpanRecoveryFrame<T>
Source§fn clone(&self) -> SpanRecoveryFrame<T>
fn clone(&self) -> SpanRecoveryFrame<T>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: Debug> Debug for SpanRecoveryFrame<T>
impl<T: Debug> Debug for SpanRecoveryFrame<T>
impl<T: Eq> Eq for SpanRecoveryFrame<T>
Source§impl<T: PartialEq> PartialEq for SpanRecoveryFrame<T>
impl<T: PartialEq> PartialEq for SpanRecoveryFrame<T>
impl<T: PartialEq> StructuralPartialEq for SpanRecoveryFrame<T>
Auto Trait Implementations§
impl<T> Freeze for SpanRecoveryFrame<T>where
T: Freeze,
impl<T> RefUnwindSafe for SpanRecoveryFrame<T>where
T: RefUnwindSafe,
impl<T> Send for SpanRecoveryFrame<T>where
T: Send,
impl<T> Sync for SpanRecoveryFrame<T>where
T: Sync,
impl<T> Unpin for SpanRecoveryFrame<T>where
T: Unpin,
impl<T> UnsafeUnpin for SpanRecoveryFrame<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for SpanRecoveryFrame<T>where
T: UnwindSafe,
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
Mutably borrows from an owned value. Read more