pub enum UserEditableSpan<T> {
Direct(T),
Recovered(T),
MacroOnly,
}Expand description
The result of recovering a user-editable span from an ordered frame chain.
Variants§
Direct(T)
The original frame was already user-editable.
Recovered(T)
A later frame recovered a user-editable span.
MacroOnly
No frame in the chain pointed at user-editable code.
Implementations§
Source§impl<T> UserEditableSpan<T>
impl<T> UserEditableSpan<T>
Sourcepub fn into_option(self) -> Option<T>
pub fn into_option(self) -> Option<T>
Converts the recovery result into an optional recovered value.
§Examples
use whitaker_common::rstest::UserEditableSpan;
use whitaker_common::span::{SourceLocation, SourceSpan};
let span = SourceSpan::new(SourceLocation::new(5, 1), SourceLocation::new(5, 7))
.expect("example span should be valid");
assert_eq!(UserEditableSpan::Recovered(span).into_option(), Some(span));
assert_eq!(UserEditableSpan::<SourceSpan>::MacroOnly.into_option(), None);Trait Implementations§
Source§impl<T: Clone> Clone for UserEditableSpan<T>
impl<T: Clone> Clone for UserEditableSpan<T>
Source§fn clone(&self) -> UserEditableSpan<T>
fn clone(&self) -> UserEditableSpan<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 UserEditableSpan<T>
impl<T: Debug> Debug for UserEditableSpan<T>
impl<T: Eq> Eq for UserEditableSpan<T>
Source§impl<T: PartialEq> PartialEq for UserEditableSpan<T>
impl<T: PartialEq> PartialEq for UserEditableSpan<T>
impl<T: PartialEq> StructuralPartialEq for UserEditableSpan<T>
Auto Trait Implementations§
impl<T> Freeze for UserEditableSpan<T>where
T: Freeze,
impl<T> RefUnwindSafe for UserEditableSpan<T>where
T: RefUnwindSafe,
impl<T> Send for UserEditableSpan<T>where
T: Send,
impl<T> Sync for UserEditableSpan<T>where
T: Sync,
impl<T> Unpin for UserEditableSpan<T>where
T: Unpin,
impl<T> UnsafeUnpin for UserEditableSpan<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for UserEditableSpan<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