[−][src]Struct moore::source::Spanned
A wrapper that associates a span with a value.
Fields
value: T
span: Span
Implementations
impl<T> Spanned<T>
[src]
pub fn new(value: T, span: Span) -> Spanned<T>
[src]
Wrap a given value together with the span it covers.
pub fn map<U, F>(self, f: F) -> Spanned<U> where
F: FnOnce(T) -> U,
[src]
F: FnOnce(T) -> U,
Map the spanned value, preserving the span.
pub fn map_into<U>(self) -> Spanned<U> where
T: Into<U>,
[src]
T: Into<U>,
pub fn as_ref(&self) -> Spanned<&T>
[src]
Trait Implementations
impl<'a, T> AcceptVisitor<'a> for Spanned<T> where
T: AcceptVisitor<'a>,
T: AcceptVisitor<'a>,
pub fn accept(&'a self, visitor: &mut dyn Visitor<'a>)
impl<T> Clone for Spanned<T> where
T: Clone,
[src]
T: Clone,
impl<T> Copy for Spanned<T> where
T: Copy,
[src]
T: Copy,
impl<T> Debug for Spanned<T> where
T: Debug,
[src]
T: Debug,
impl<T> Display for Spanned<T> where
T: Display,
[src]
T: Display,
impl<T> Eq for Spanned<T> where
T: Eq,
[src]
T: Eq,
impl<'a, T> ForEachNode<'a> for Spanned<T> where
T: ForEachNode<'a>,
T: ForEachNode<'a>,
pub fn for_each_node(&'a self, each: &mut dyn FnMut(&'a (dyn AnyNode<'a> + 'a)))
impl<T> HasDesc for Spanned<T> where
T: HasDesc,
[src]
T: HasDesc,
impl<T> HasSpan for Spanned<T>
[src]
impl<T> Hash for Spanned<T> where
T: Hash,
[src]
T: Hash,
pub fn hash<H>(&self, state: &mut H) where
H: Hasher,
[src]
H: Hasher,
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<'lazy, 'sb, 'ast, 'ctx> NodeMaker<ArrayTypeIndexRef, &'ctx Spanned<ArrayTypeIndex>> for ScoreContext<'lazy, 'sb, 'ast, 'ctx>
[src]
pub fn make(
&self,
id: ArrayTypeIndexRef
) -> Result<&'ctx Spanned<ArrayTypeIndex>, ()>
[src]
&self,
id: ArrayTypeIndexRef
) -> Result<&'ctx Spanned<ArrayTypeIndex>, ()>
impl<'lazy, 'sb, 'ast, 'ctx> NodeMaker<LatentTypeMarkRef, Spanned<TypeMarkRef>> for ScoreContext<'lazy, 'sb, 'ast, 'ctx>
[src]
pub fn make(&self, id: LatentTypeMarkRef) -> Result<Spanned<TypeMarkRef>, ()>
[src]
impl<T> Ord for Spanned<T> where
T: Ord,
[src]
T: Ord,
pub fn cmp(&self, other: &Spanned<T>) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl<T> PartialEq<Spanned<T>> for Spanned<T> where
T: PartialEq<T>,
[src]
T: PartialEq<T>,
impl<T> PartialOrd<Spanned<T>> for Spanned<T> where
T: PartialOrd<T>,
[src]
T: PartialOrd<T>,
pub fn partial_cmp(&self, other: &Spanned<T>) -> Option<Ordering>
[src]
pub fn lt(&self, other: &Spanned<T>) -> bool
[src]
pub fn le(&self, other: &Spanned<T>) -> bool
[src]
pub fn gt(&self, other: &Spanned<T>) -> bool
[src]
pub fn ge(&self, other: &Spanned<T>) -> bool
[src]
impl<T> StructuralEq for Spanned<T>
[src]
impl<T> StructuralPartialEq for Spanned<T>
[src]
impl<'a, T> WalkVisitor<'a> for Spanned<T> where
T: WalkVisitor<'a>,
T: WalkVisitor<'a>,
pub fn walk(&'a self, visitor: &mut dyn Visitor<'a>)
Auto Trait Implementations
impl<T> RefUnwindSafe for Spanned<T> where
T: RefUnwindSafe,
[src]
T: RefUnwindSafe,
impl<T> Send for Spanned<T> where
T: Send,
[src]
T: Send,
impl<T> Sync for Spanned<T> where
T: Sync,
[src]
T: Sync,
impl<T> Unpin for Spanned<T> where
T: Unpin,
[src]
T: Unpin,
impl<T> UnwindSafe for Spanned<T> where
T: UnwindSafe,
[src]
T: UnwindSafe,
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> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
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> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
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>,