[][src]Struct markedit::FallingEdge

pub struct FallingEdge<M> { /* fields omitted */ }

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]

impl<M: Debug> Debug for FallingEdge<M>[src]

impl<M: Matcher> Matcher for FallingEdge<M>[src]

impl<M: PartialEq> PartialEq<FallingEdge<M>> for FallingEdge<M>[src]

impl<M> StructuralPartialEq for FallingEdge<M>[src]

Auto Trait Implementations

impl<M> RefUnwindSafe for FallingEdge<M> where
    M: RefUnwindSafe

impl<M> Send for FallingEdge<M> where
    M: Send

impl<M> Sync for FallingEdge<M> where
    M: Sync

impl<M> Unpin for FallingEdge<M> where
    M: Unpin

impl<M> UnwindSafe for FallingEdge<M> where
    M: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.