[−][src]Struct markedit::FallingEdge
A Matcher
which will detect the falling edge of another.
Examples
let matches_something = markedit::exact_text("Something"); let mut matcher = FallingEdge::new(matches_something); // enter the paragraph let got = matcher.matches_event(&Event::Start(Tag::Paragraph)); assert_eq!(got, false); // then encounter some text. matches_something should have gone from false -> true let got = matcher.matches_event(&Event::Text("Something".into())); assert_eq!(got, false); // then leave the paragraph. `matches_something` should go from true -> false let got = matcher.matches_event(&Event::End(Tag::Paragraph)); assert_eq!(got, true, "We've entered a paragraph");
Methods
impl<M> FallingEdge<M>
[src]
pub const fn new(inner: M) -> Self
[src]
Create a new FallingEdge
matcher.
Trait Implementations
impl<M: Clone> Clone for FallingEdge<M>
[src]
fn clone(&self) -> FallingEdge<M>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<M: Debug> Debug for FallingEdge<M>
[src]
impl<M: Matcher> Matcher for FallingEdge<M>
[src]
fn matches_event(&mut self, event: &Event) -> bool
[src]
fn first_match(&mut self, events: &[Event]) -> Option<usize>
[src]
fn is_in<'src, I, E>(self, events: I) -> bool where
I: IntoIterator<Item = E> + 'src,
E: Borrow<Event<'src>>,
Self: Sized,
[src]
I: IntoIterator<Item = E> + 'src,
E: Borrow<Event<'src>>,
Self: Sized,
fn then_start_of_next_line(self) -> StartOfNextLine<Self> where
Self: Sized,
[src]
Self: Sized,
fn fuse(self) -> OneShot<Self> where
Self: Sized,
[src]
Self: Sized,
fn falling_edge(self) -> FallingEdge<Self> where
Self: Sized,
[src]
Self: Sized,
fn and<M>(self, other: M) -> And<Self, M> where
Self: Sized,
M: Matcher,
[src]
Self: Sized,
M: Matcher,
impl<M: PartialEq> PartialEq<FallingEdge<M>> for FallingEdge<M>
[src]
fn eq(&self, other: &FallingEdge<M>) -> bool
[src]
fn ne(&self, other: &FallingEdge<M>) -> bool
[src]
impl<M> StructuralPartialEq for FallingEdge<M>
[src]
Auto Trait Implementations
impl<M> RefUnwindSafe for FallingEdge<M> where
M: RefUnwindSafe,
M: RefUnwindSafe,
impl<M> Send for FallingEdge<M> where
M: Send,
M: Send,
impl<M> Sync for FallingEdge<M> where
M: Sync,
M: Sync,
impl<M> Unpin for FallingEdge<M> where
M: Unpin,
M: Unpin,
impl<M> UnwindSafe for FallingEdge<M> where
M: UnwindSafe,
M: 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,
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> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
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.
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>,