pub struct Spanned<T> {
pub value: T,
pub offset: usize,
pub attached: bool,
}Expand description
A value with where it was found: an Occurrence variant holding a
Spanned<T> gets the flag’s (or word’s) offset and whether the value was
attached (-zfoo, --name=value) or the next word (-z foo).
For errors that point at an item of a sequence (--pop-state with nothing
pushed), and for messages that echo the spelling given.
Fields§
§value: TThe value.
offset: usizeByte offset of the flag, or of the word for a positional, as
Argv::offset counts.
attached: boolWhether the value was in the flag’s own word.
Trait Implementations§
impl<T: Copy> Copy for Spanned<T>
impl<T: Eq> Eq for Spanned<T>
impl<T: PartialEq> StructuralPartialEq for Spanned<T>
Auto Trait Implementations§
impl<T> Freeze for Spanned<T>where
T: Freeze,
impl<T> RefUnwindSafe for Spanned<T>where
T: RefUnwindSafe,
impl<T> Send for Spanned<T>where
T: Send,
impl<T> Sync for Spanned<T>where
T: Sync,
impl<T> Unpin for Spanned<T>where
T: Unpin,
impl<T> UnsafeUnpin for Spanned<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Spanned<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