pub struct Event<T> {
pub span: EventSpan,
pub value: T,
}Expand description
An event yielded by a pattern query, see Pattern::query.
Fields§
§span: EventSpanThe span of the event (both “active” and “whole” parts).
value: TThe value associated with the event.
Implementations§
Source§impl<T> Event<T>
impl<T> Event<T>
pub fn new(value: T, active: Span, whole: Option<Span>) -> Self
pub fn map<U>(self, map: impl FnOnce(T) -> U) -> Event<U>
pub fn map_spans(self, map: impl Fn(Span) -> Span) -> Self
pub fn map_points(self, map: impl Fn(Rational) -> Rational) -> Self
pub fn map_len(self, map: impl Fn(Rational) -> Rational) -> Self
pub fn by_ref(&self) -> Event<&T>
Trait Implementations§
Source§impl<T: Ord> Ord for Event<T>
impl<T: Ord> Ord for Event<T>
Source§impl<T: PartialOrd> PartialOrd for Event<T>
impl<T: PartialOrd> PartialOrd for Event<T>
impl<T: Copy> Copy for Event<T>
impl<T: Eq> Eq for Event<T>
impl<T> StructuralPartialEq for Event<T>
Auto Trait Implementations§
impl<T> Freeze for Event<T>where
T: Freeze,
impl<T> RefUnwindSafe for Event<T>where
T: RefUnwindSafe,
impl<T> Send for Event<T>where
T: Send,
impl<T> Sync for Event<T>where
T: Sync,
impl<T> Unpin for Event<T>where
T: Unpin,
impl<T> UnwindSafe for Event<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